Samsung Keyboard backspace causes crash
OS: Android 10-14 · Device: Mobile (Samsung Galaxy S9, Note series, etc.) Any · Browser: Chrome for Android 120+ · Keyboard: English (QWERTY)
Open case →Scenario
On Android with Samsung Keyboard, holding the backspace key to delete text causes the contenteditable editor to crash completely. JavaScript execution stops and page becomes unresponsive.
On Android with Samsung Keyboard, holding the backspace key to delete text causes the contenteditable editor to crash completely.
This issue occurs specifically when:
Samsung Keyboard’s backspace handling appears to have a race condition or memory corruption when:
Rate-limit backspace events:
let lastBackspaceTime = 0;
const BACKSPACE_DELAY = 50; // 50ms between events
editor.addEventListener('keydown', (e) => {
if (e.key === 'Backspace') {
const now = Date.now();
if (now - lastBackspaceTime < BACKSPACE_DELAY) {
e.preventDefault();
console.warn('Backspace rate limited');
return;
}
lastBackspaceTime = now;
}
});
Use try-catch around DOM operations:
editor.addEventListener('input', (e) => {
try {
// Handle input
} catch (error) {
console.error('Input error:', error);
// Recover gracefully
}
});
Debouce backspace handling:
let backspaceTimeout = null;
editor.addEventListener('keydown', (e) => {
if (e.key === 'Backspace') {
clearTimeout(backspaceTimeout);
backspaceTimeout = setTimeout(() => {
// Handle backspace with delay
performBackspace();
}, 10); // 10ms debounce
}
});
Provide user education:
Use MutationObserver for DOM changes:
const observer = new MutationObserver((mutations) => {
try {
// Validate DOM changes
} catch (error) {
console.error('Mutation error:', error);
}
});
observer.observe(editor, {
childList: true,
subtree: true,
characterData: true
});
Visual view of how this scenario connects to its concrete cases and environments. Nodes can be dragged and clicked.
Each row is a concrete case for this scenario, with a dedicated document and playground.
| Case | OS | Device | Browser | Keyboard | Status |
|---|---|---|---|---|---|
| ce-0291-samsung-backspace-crash-en | Android 10-14 | Mobile (Samsung Galaxy S9, Note series, etc.) Any | Chrome for Android 120+ | English (QWERTY) | draft |
Open a case to see the detailed description and its dedicated playground.
OS: Android 10-14 · Device: Mobile (Samsung Galaxy S9, Note series, etc.) Any · Browser: Chrome for Android 120+ · Keyboard: English (QWERTY)
Open case →Other scenarios that share similar tags or category.
Samsung keyboard's text prediction feature causes various input event handling issues in contenteditable elements on Android Chrome, including insertCompositionText events, missing getTargetRanges(), selection mismatches, and combined event.data when typing adjacent to links or formatted elements.
In Chrome on Android, input events may fire when a contenteditable element gains or loses focus, even without content changes. This behavior can lead to unintended side effects in applications relying on input events for content modification detection.
The enterkeyhint attribute, which controls the label on the Enter key on mobile keyboards, does not work on contenteditable elements. The Enter key label remains the default regardless of the attribute value.
When a contenteditable element has CSS backdrop-filter applied, rendering may be affected. Text may appear blurry, selection may not render correctly, and performance may be degraded, especially on mobile devices.
On mobile devices, the combination of enterkeyhint and inputmode attributes may affect Enter key behavior inconsistently on contenteditable elements. The Enter key may insert line breaks when it should perform an action, or vice versa.
Have questions, suggestions, or want to share your experience? Join the discussion below.