Skip to content

Commit

Permalink
Fix terminal height resizing on zoom (mobile)
Browse files Browse the repository at this point in the history
  • Loading branch information
cowuake committed Apr 28, 2024
1 parent 181ddb8 commit 5f801c6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/jquery.terminal-src.js
Original file line number Diff line number Diff line change
Expand Up @@ -5298,11 +5298,14 @@
// -------------------------------------------------------------------------
function on_height_change(callback) {
var height = window.visualViewport.height;
var scale = window.visualViewport.scale;
height = Math.round(height * scale);
callback(height);
window.visualViewport.addEventListener('resize', function() {
var newHeight = window.visualViewport.height;
var newScale = window.visualViewport.scale;
if (height !== newHeight) {
height = newHeight;
height = Math.round(newHeight * newScale);
callback(height);
}
});
Expand Down

0 comments on commit 5f801c6

Please sign in to comment.