commit 23081e14b991a8dc5331996008e80cfb4e77e178
parent ea51929e9d34cabcdc7931457c980c43565383f5
Author: Hunter
Date: Mon, 28 Jul 2025 00:03:52 -0400
mobile: fix bug where android virtual keyboard always switched to starting layer on rerender
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/index.html b/index.html
@@ -252,6 +252,12 @@
}
function updatePreview() {
+ // Skip preview updates while mobile keyboard is open and editor is focused
+ // This prevents keyboard layer resets on Android
+ if (isMobileDevice() && isEditorFocused && document.body.classList.contains('mobile-keyboard-open')) {
+ return;
+ }
+
const code = editorView.state.doc.toString();
// Extract and update title and favicon from user's HTML
@@ -481,6 +487,8 @@
document.documentElement.style.setProperty('--visible-height', '100vh');
// Reset background color
document.body.style.backgroundColor = '';
+ // Update preview when keyboard closes to show any changes made while typing
+ updatePreview();
}
}