tools: standalone CM iOS autocaps / pendingIOSKey repro#304
Open
Stvad wants to merge 2 commits into
Open
Conversation
A minimal, app-free CodeMirror 6 page to test on a real iOS device whether the WebKit soft-keyboard autocapitalization bug behind CM's pendingIOSKey deferral (codemirror/dev #165, #433) is still present. Two editors: a CONTROL using CM's real pendingIOSKey native-passthrough, and a TEST that preventDefaults Enter/Backspace/Delete + applies the edit via a CM transaction (programmatic DOM-selection move = the exact #165 condition). The inserted character's case is the objective verdict. Self-contained: vendors the exact @codemirror/view@6.43.0 + @codemirror/state ESM out of node_modules behind an importmap (sync-vendor.mjs; vendor/ gitignored), served by a tiny dep-free static server for the ios-device-debug tunnel loop. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A minimal, standalone CodeMirror 6 page (no knowledge-medium app code) to determine, on a real iOS device, whether the WebKit soft-keyboard state bug behind CodeMirror's
pendingIOSKeydeferral is still present.Original issue being tested
The root issue is
codemirror/dev#165: when JavaScript moves the browser's DOM Selection, iOS Safari can keep the soft keyboard's autocapitalize/autocomplete state from the old caret position.That is the behavior CodeMirror works around with
pendingIOSKey/flushIOSKey: for iOS Enter/Backspace/Delete, CM lets the native key action update the keyboard state first, then retroactively runs the keybinding and resets the DOM. The latercodemirror/dev#433 thread helped exercise Enter/Backspace symptoms and follow-up regressions, but it is not the original bug.The repro
Two CodeMirror editors, seeded identically per scenario:
EditorView; on iOS its keys go through CM's realpendingIOSKeynative-passthrough path.Selection.collapse(...)at the new cursor position so the trace proves the DOM selection moved by script.The default Script move scenario targets #165 directly without involving a key workaround:
qfor the native baseline.q.The Enter and Backspace scenarios are the
pendingIOSKeysoft-keyboard cases that matter to our app. Delete is a hardware-keyboard sanity probe only.Self-contained
Vendors the exact
@codemirror/view@6.43.0+@codemirror/state@6.6.0ESM out ofnode_modulesbehind an importmap (sync-vendor.mjs;vendor/gitignored), served by a tiny dep-free static server for theios-device-debugtunnel loop. Seetools/ios-autocaps-repro/README.md.Status
Repro built and smoke-tested on desktop/headless Chromium; on-device run + verdict pending because native soft-keyboard behavior must be tested by physically typing on an iOS device.
🤖 Generated with Claude Code