mobile: fix bug where android virtual keyboard always switched to starting layer on rerender

Hunter
Monday, July 28th, 2025 at 12:03 AM

index.html+8 

index.html
252  		}
253  
254  		function updatePreview() {
255 +			// Skip preview updates while mobile keyboard is open and editor is focused
256 +			// This prevents keyboard layer resets on Android
257 +			if (isMobileDevice() && isEditorFocused && document.body.classList.contains('mobile-keyboard-open')) {
258 +				return;
259 +			}
260 +			
261  			const code = editorView.state.doc.toString();
262  			
263  			// Extract and update title and favicon from user's HTML

487  				document.documentElement.style.setProperty('--visible-height', '100vh');
488  				// Reset background color
489  				document.body.style.backgroundColor = '';
490 +				// Update preview when keyboard closes to show any changes made while typing
491 +				updatePreview();
492  			}
493  		}
494