Fix(Web): exit remote-desktop fullscreen blocks device-list clicks

This commit is contained in:
yuanyuanxiang
2026-05-19 22:20:55 +02:00
parent 1c1bb3a5ff
commit 707dcdbbb4

View File

@@ -1873,6 +1873,24 @@
} }
function showPage(pageId) { function showPage(pageId) {
// Leaving the remote-desktop page? Drop fullscreen first.
// #screen-page is the requestFullscreen target; while it remains
// the document.fullscreenElement the browser blocks pointer /
// keyboard interaction with anything outside its subtree —
// devices-page lives outside it, so without this exit a click
// ANYWHERE on the device list silently no-ops until the user
// hits ESC themselves. Same hazard for device_offline auto-
// navigation, manual Back, and any future navigation we add.
if (pageId !== 'screen-page') {
const sp = document.getElementById('screen-page');
if (sp && sp.classList.contains('active')) {
if (document.fullscreenElement || document.webkitFullscreenElement) {
const exit = document.exitFullscreen || document.webkitExitFullscreen;
if (exit) exit.call(document).catch(() => {});
}
sp.classList.remove('pseudo-fullscreen'); // iOS fallback path
}
}
document.querySelectorAll('.page').forEach(p => p.classList.remove('active')); document.querySelectorAll('.page').forEach(p => p.classList.remove('active'));
document.getElementById(pageId).classList.add('active'); document.getElementById(pageId).classList.add('active');
} }