Skip to content

fix(ios): match software Return before native input actions - #1967

Merged
houko merged 2 commits into
mainfrom
fix/ios-software-return-1351
Nov 22, 2026
Merged

houko merged 2 commits into
mainfrom
fix/ios-software-return-1351

Conversation

@houko

@houko houko commented Nov 22, 2026

Copy link
Copy Markdown
Collaborator

A software Return currently bypasses the iOS keymap and reaches UITextField submission/blur or UITextView newline handling directly. An always-active Enter binding cannot prevent those native actions.

Offer each software Return to the surface's current keymap before native handling. Preserve automatic/not-editing bindings' normal yielding, marked-text composition, programmatic edits, input modality and complete software actions without a held-key repeat timer. Match physical Return at the editor with its actual modifiers, so an unhandled modified key is never matched again as an unmodified software Return. Route the physical-device test fallback through the same field action.

Update the public forms docs, architecture, remaining roadmap gaps, skill and changelog. Android already routes IME actions/newlines through its key matcher; its implementation is unchanged.

Closes #1351.

Validation:

  • Reproduced the original failure on an isolated iPhone 16 / iOS 18.4 simulator: software Return fired zero bindings, submitted once and blurred once.
  • go tool nsgo test -target ios_simulator -device DB612BC9-CED7-4D1E-A9B5-D652F105F242 -run '^Test(Input|Multiline|Titled|SoftwareReturn|HardwareReturn)' ./internal/platform/ios: 13 passed. Nine new native regressions cover both editor classes, submit/newline controls, newer automatic-binding precedence, marked text, programmatic edits, HID Return and modifiers, and the physical-device fallback with no held/repeating software key. Four existing native input/menu regressions also passed.
  • go tool nsgo check -target ios,ios_simulator,tvos,tvos_simulator -jobs 2: all four targets passed.
  • go tool nsgo test ./internal/platform/ios: 18 host logic tests passed.
  • go tool nsgo test ./internal/moduletest: 12 passed, including layering, public API names and skills.
  • go tool nsgo test ./tools/changelog: 11 passed; git diff --check passed.

Verification used a task-owned local simulator and an isolated Go cache. Physical iPhone and tvOS runtime execution are not claimed.

@github-actions github-actions Bot added bug Something isn't working documentation Improvements or additions to documentation iOS size/M labels Nov 22, 2026
@github-actions github-actions Bot added the conflict Conflicts with the base branch; resolve it first label Nov 22, 2026
@houko
houko force-pushed the fix/ios-software-return-1351 branch from 182b5f2 to 04034a5 Compare November 22, 2026 14:55
@houko

houko commented Nov 22, 2026

Copy link
Copy Markdown
Collaborator Author

Reviewed. Software Return from textFieldShouldReturn: and a text view's newline now goes to the keymap first, skipped while composing, for programmatic edits and while a physical Return is being handled; physical Return is matched in pressesBegan with its modifiers and falls through to super when nothing binds it. Rebased onto main (docs-only conflicts), pushed 04034a5, which also updates the skills/roadmap text now that main gives KeyAlways Backspace and select-all first on the mobile test hosts, and flattens the new comments. go vet -tags nsgotest for GOOS=ios passes; the earlier test/android/apple failures were in unrelated audio, Android overflow-press and web-mute tests.

@houko
houko merged commit bd4b309 into main Nov 22, 2026
14 of 17 checks passed
@houko
houko deleted the fix/ios-software-return-1351 branch November 22, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working conflict Conflicts with the base branch; resolve it first documentation Improvements or additions to documentation iOS size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keyboard: Software Return on iOS

1 participant