client: Fix chat window disappear on mobile

The chat window appears when #show-chat is clicked. That click leads
to #left becoming visible, which contains chat elements. However when
mobile user taps #input, on-screen keyboard appears, which triggers
screen resize -> setViewportHeight() and the latter calls showVideo()
which hides the chat completely.

-> Fix that by doing showVideo() in setViewportHeight() only if we were
not in chat mode.
This commit is contained in:
Kirill Smelkov
2026-03-07 21:52:39 +03:00
committed by Juliusz Chroboczek
parent 888aa9bcd1
commit 499b750508
+13 -1
View File
@@ -533,7 +533,9 @@ function setViewportHeight() {
document.documentElement.style.setProperty(
'--vh', `${window.innerHeight/100}px`,
);
showVideo();
if (!getVisibility('left')) {
showVideo();
}
// Ajust video component size
resizePeers();
}
@@ -577,6 +579,16 @@ function setVisibility(id, visible) {
elt.classList.add('invisible');
}
/**
* getVisibility tells whether specified element is visible.
*
* @param {string} id
*/
function getVisibility(id) {
let elt = document.getElementById(id);
return !elt.classList.contains('invisible');
}
/**
* Shows and hides various UI elements depending on the protocol state.
*/