fix(ios): keyboard dismiss never presses the return key

Merged
TH
10d ago
+738-103

Summary

keyboard dismiss on iOS pressed a return key labelled "Done" as if it were a dismiss key, so the form submitted. RunnerKeyboardStatus.returnControl now decides which key is the return key. keyboard status reports it and keyboard dismiss excludes it. The iPad hide-keyboard key and a "Done" toolbar above the keys stay dismiss keys. With no other dismiss key, dismiss refuses with keyboard_dismiss_unavailable (dispatched: no). keyboard enter still submits.

10 files. The iOS e2e now asserts the refusal and uses keyboard enter where it needed the field's submit to hide the keyboard. Help and commands.md say dismiss never presses the return key. Closes #4640.

Validation

Device: iPhone Air simulator, iOS 27.0 (1B89356B-961C-4993-B0BE-4C0F3917D995), Wallet sign-up, focus in the password field (keyboard status: returnKey: done).

  • Base 1cb2f242ae: keyboard dismiss โ†’ dismissed: true, mechanism: dismissKey; app lands on Home ("Hi, Review").
  • Head fc45a008b3: keyboard dismiss โ†’ success: false, KEYBOARD_DISMISS_UNAVAILABLE, reason: keyboard_dismiss_unavailable, dispatched: "no". The sign-up form stays, the password field is [focused], and keyboard status still reports the keyboard visible.
  • Name field (returnKey: next): refuses the same way at base and head.
  • Runner XCUITests on that simulator, 6 of 6 pass: testKeyboardDismissNeverPressesADoneReturnKey, testKeyboardDismissPressesTheDoneToolbarNotTheDoneReturnKey, testKeyboardDismissTapsItsDismissKeyWhileTheAppIsBusy, testKeyboardEnterPressesReturnWhileTheAppIsBusy, and two pure return-key tests. With the exclusion disabled, the first two fail.
  • Local: focused vitest, pnpm typecheck, pnpm lint, pnpm check:xctest-selection pass. The full gate is left to CI.

Risk: the iOS simulator e2e edit in live-runner.ts was not run live.

๐Ÿค– Generated with Claude Code


Autofix with [code]smith
Open in [code]smith ยท Need help on this PR? Tag @codesmith-bot with what you need.