Fix #5010: don't reroute taps on the active native text editor#5026
Merged
Conversation
…N1's pointer pipeline CN1TapGestureRecognizer is installed on the window with cancelsTouchesInView=NO, so it sees every touch in the window -- including taps that land on the CN1UITextField / CN1UITextView created by editStringAtImpl. The shouldBeRequiredToFailByGestureRecognizer: gate added in #5003 made CN1TapGR win priority over the iOS-26 auto-installed _keyboardDismissalGestureRecognized: tap, which (combined with the always-on foldKeyboard call in touchesEnded) turned every tap inside the field into: CN1TapGR.touchesEnded -> [ctrl foldKeyboard:point] -> point falls outside the 22pt-tall field rect for a single-line TextField almost any time the user isn't pixel-perfect (cursor positioning drag, long-press for the magnifier, even a slightly off-center tap) -> stringEdit(YES,...) tears down editingComponent -> pointerReleasedC dispatches the same touch into Java -> TextArea.pointerReleased -> editString -> editStringAtImpl re-creates the field The visible symptom (#5010 follow-ups, captured in the on-device trace): the keyboard bounces, the selection / cursor jumps back to the default position on every interaction, and on iOS 26.x devices the rapid session churn fails the RTI UIEmojiSearchOperations probe -- which on iPhone 14 Plus / iOS 26.4.2 escalates to a full-app freeze. Fix: extend ignoreEvent: to ignore touches whose pressedView is a descendant of editingComponent. UIKit owns those touches for cursor positioning, selection handles, the magnifier loupe, and on iOS 26.x the RTI / emoji- search input session. CN1TapGR still processes everything else (taps on peer components, taps on the empty form area, taps that should dismiss the keyboard via foldKeyboard). Verified on iPhone 17 Pro / iOS 26.x build of the AddressBook repro (single TextField in BorderLayout.CENTER, the snippet from the issue report): typing works straight through, the keyboard no longer bounces on tap, cursor positioning lands where the user taps, and the RTI emoji- search errors stop firing entirely. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
Collaborator
Author
|
Compared 110 screenshots: 110 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
Collaborator
Author
|
Compared 110 screenshots: 110 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
4 tasks
shai-almog
added a commit
that referenced
this pull request
May 24, 2026
KeyTypeStep was added in #5013 to assert that HW-keyboard typeText (XCUITest's HW-keyboard pathway, surfacing as UIPress events on iOS 13.4+) reaches the focused CN1UITextField's insertText: via the responder chain walk through CodenameOne_GLViewController. That walk depends on the controller's pressesBegan: forwarding to [super pressesBegan:] while a field is being edited. The companion commit on this branch makes pressesBegan / pressesEnded / pressesCancelled return early without forwarding super while editingComponent != nil, because that same forwarding is the suspected trigger for the iOS-26.4.2 freeze the reporter still sees after #5026. The two fixes are mutually exclusive on the simulator: enable HW typing via super forwarding (KeyTypeStep passes, virtual-keyboard freeze persists), or block super forwarding (freeze hopefully fixed, KeyTypeStep times out on the typeText path). Disable KeyTypeStep here while we ship the freeze probe to the reporter. All three layers are commented (not deleted) so re-enabling is a one-line revert once the right fix that preserves both paths is known: - GestureSuite.java: KeyTypeStep dropped from the steps[] array - InputValidationUITests.swift: driveKeyType call commented, helper kept - drivers/run-ios.sh: CN1IV:READY:keytype + CN1IV:EVENT:keytype dropped from REQUIRED_EVENTS Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
shai-almog
added a commit
that referenced
this pull request
May 24, 2026
…editing (#5027) * Fix #5010: make pressesBegan/Ended/Cancelled fully transparent while editing The #5013 hotfix changed pressesBegan/Ended/Cancelled to call [super pressesBegan:] when a native text editor was up, instead of swallowing the press via the cn1MapUIKeyToKeyCode path. The intent was to let UIKit's text-input pipeline deliver the press to the focused CN1UITextField. That worked on the iOS 26.3 simulator (where the verification happened) but did not fix the freeze the reporter saw on iPhone 14 Plus / iOS 26.4.2. The CN1UITextField is the first responder. iOS delivers UIPress events to the first responder first; the field's own pressesBegan: / insertText: handles printable keys before the event walks up the responder chain to our view controller. Forwarding to [super pressesBegan:] from our override re-enters UIViewController's default chain walk, which on iOS 26.4.2 hangs the next inbound key delivery -- the user sees a focused field where typing does nothing and the rest of the app freezes, requiring a restart. Change each press handler to return immediately when editingComponent is set, with no [super pressesBegan:] forwarding. The override is now fully transparent while editing: the field's own handling stands and the chain stops here. HW-keyboard support (#3498 / #4982) for non- editing state is preserved by the unchanged fallthrough. Also adds bounded CN1Log markers at each press handler entry and at editStringAtImpl entry so any future device log can correlate edit session start, press routing, and the editing-vs-not branch taken. Volume is bounded -- pressesBegan only fires on physical key events, and editStringAtImpl only fires once per edit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Input validation: disable KeyTypeStep pending #5010 resolution KeyTypeStep was added in #5013 to assert that HW-keyboard typeText (XCUITest's HW-keyboard pathway, surfacing as UIPress events on iOS 13.4+) reaches the focused CN1UITextField's insertText: via the responder chain walk through CodenameOne_GLViewController. That walk depends on the controller's pressesBegan: forwarding to [super pressesBegan:] while a field is being edited. The companion commit on this branch makes pressesBegan / pressesEnded / pressesCancelled return early without forwarding super while editingComponent != nil, because that same forwarding is the suspected trigger for the iOS-26.4.2 freeze the reporter still sees after #5026. The two fixes are mutually exclusive on the simulator: enable HW typing via super forwarding (KeyTypeStep passes, virtual-keyboard freeze persists), or block super forwarding (freeze hopefully fixed, KeyTypeStep times out on the typeText path). Disable KeyTypeStep here while we ship the freeze probe to the reporter. All three layers are commented (not deleted) so re-enabling is a one-line revert once the right fix that preserves both paths is known: - GestureSuite.java: KeyTypeStep dropped from the steps[] array - InputValidationUITests.swift: driveKeyType call commented, helper kept - drivers/run-ios.sh: CN1IV:READY:keytype + CN1IV:EVENT:keytype dropped from REQUIRED_EVENTS Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
shai-almog
added a commit
that referenced
this pull request
May 26, 2026
…firmed (#5041) Removes the iOS native edits and the input-validation test scaffolding that were added to chase issue #5010. The bug reporter's symptoms could not be independently reproduced, so the workarounds are removed: - pressesBegan/Ended/Cancelled editingComponent guards in CodenameOne_GLViewController (PRs #5013, #5027) - ignoreEvent extension on CN1TapGestureRecognizer (PR #5026) - CN1Log [#5010] diagnostic markers in editStringAtImpl and the press handlers (PR #5027) - KeyTypeStep + driveKeyType XCUITest scaffolding that only existed to validate the fix path (PR #5013) CodenameOne_GLViewController.m is now byte-identical to its pre-#5010 baseline; CN1TapGestureRecognizer.m differs only in two trailing- whitespace cleanups. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 tasks
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.
Summary
Two distinct iOS-26 keyboard regressions surface when editing a
TextField. Both are addressed here. The first matches @shai-almog's local repro (bouncing keyboard, cursor jumping back, selection lost on every interaction); the second matches the reporter's iPhone 14 Plus / iOS 26.4.2 repro from #5010 (focused field, typing does nothing, app freezes, requires restart).Bug 1 —
CN1TapGestureRecognizerreroutes taps on the editing field into Java's pointer pipelineCN1TapGestureRecognizeris installed on the window withcancelsTouchesInView=NO, so it sees every touch — including taps that land on the activeCN1UITextField. After #5003'sshouldBeRequiredToFailByGestureRecognizer:gate, CN1TapGR wins priority over the iOS-26 auto-installed_keyboardDismissalGestureRecognized:tap. Combined with the always-onfoldKeyboardcall intouchesEnded, every tap inside the field now:Visible symptom (captured in an on-device trace): keyboard bounces on tap, cursor / selection jumps back to default on every interaction, and
RTIInputSystemClient ... perform input operation requires a valid sessionID. customInfoType = UIEmojiSearchOperationserrors flood the log as iOS 26 reacts to the input-session churn.Fix: extend
CN1TapGestureRecognizer.ignoreEvent:to ignore touches whosepressedViewis a descendant ofeditingComponent. UIKit then owns those touches for cursor positioning, selection handles, the magnifier loupe, and the iOS-26 RTI input session.Bug 2 —
pressesBegan:forwarding to[super pressesBegan:]hangs key delivery on iOS 26.4.2The #5013 hotfix changed our
pressesBegan/pressesEnded/pressesCancelledoverrides onCodenameOne_GLViewControllerto call[super pressesBegan:]when a native text editor was up, instead of swallowing the press viacn1MapUIKeyToKeyCode. The intent was to let UIKit's text-input pipeline deliver the press to the focusedCN1UITextField. That worked on the iOS 26.3 simulator (where the verification ran) but did not fix the reporter's freeze on iPhone 14 Plus / iOS 26.4.2.CN1UITextFieldis the first responder. iOS deliversUIPressevents to the first responder first; the field's ownpressesBegan:/insertText:handles printable keys before the event walks up the responder chain to our view controller. Forwarding to[super pressesBegan:]from our override re-entersUIViewController's default chain walk, which on iOS 26.4.2 hangs the next inbound key delivery — focused field, typing does nothing, rest of the app frozen, requires app restart.Fix: make each press handler return immediately when
editingComponent != nil, with no[super pressesBegan:]forwarding. The override is now fully transparent while editing — the field's own handling stands and the chain stops here. HW-keyboard support (#3498 / #4982) for non-editing state is preserved by the unchanged fallthrough.Defensive diagnostics
Bounded
CN1Logmarkers added at each press-handler entry and ateditStringAtImplentry so any future device log can correlate edit-session start, press routing, and the editing-vs-not branch taken. Volume is bounded —pressesBeganonly fires on physical key events;editStringAtImplonly fires once per edit.Test plan
new TextField("Testing")inBorderLayout.CENTER) on iPhone 14 Plus / iOS 26.4.2: typing now lands characters in the field; app stays responsive; no need to restart.foldKeyboardpath remains active for touches whosepressedViewis not undereditingComponent).keyPressed/keyReleasedoutside of editing (pressesBeganfallthrough unchanged).[#5010] editStringAtImpl ENTRY ...once per edit, and[#5010] pressesBegan SKIPPED while editing ...for each key during HW-keyboard input — confirms the new bypass is taken without re-entering super.🤖 Generated with Claude Code