fix: keyboard and input bugs found by replaying other libraries' issues - #55
Merged
Merged
Conversation
- iOS: route delegate calls misdirected by keyboard-controller's shared composite delegate to the field they belong to, and reclaim the field's own delegate before editing (keyboard-controller#1588): a focused field took no typing after a push. - focus() before the view is ever on screen is taken whatever the keyboard is doing, like autoFocus (a free-text step after a tap-only one never opened the keyboard). Both platforms. - iOS: an autoFocus field on a screen pushed without a slide keeps its focus through the transition: no onBlur/onFocus pair and no keyboard dip (react-navigation#11643, #11626). - iOS: a selection set while blurred is applied on focus (RN#46943). - iOS: IME compositions (Japanese, Chinese, Korean) are left alone with maxLength or a transform, and conformed once committed (RN#56463, #52552). - Android: maxLength counts code points when typing; keyboard prop changes on a focused field keep the caret (RN#38676). - New harness suite replaying 23 issue reproductions; a mount-focus test in the keyboard suite. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Bugs found by integrating 0.3.3 into Uno and by replaying reproductions from open issues in keyboard-controller, react-native, react-native-screens and react-navigation. Patch release material (0.3.4).
Fixes
iOS: focused field that takes no typing (keyboard-controller#1588)
autoFocusfield while a number field had the keyboard. Keystrokes went to the number field, which dropped the letters.focus()at mount opens the keyboard even when it is down (both platforms)focus()that arrived before the view was on screen was only honoured while the keyboard was up.autoFocusdoes. Screens navigated back to keep the old rule.iOS:
autoFocuson a push with no slide (react-navigation#11643, #11626)animation: 'none','fade'and'simple_push'.onBlur/onFocuspair and a keyboard dip.blur(), another field claiming focus, the handoff stand-in and leaving the window still resign it.iOS:
selectionset while blurred is applied on focus (RN#46943).iOS: IME composition (Japanese, Chinese, Korean) with
maxLengthortransform(RN#56463, #52552)maxLengthand the transform apply once the text is committed.maxLengthon commit.Android
maxLengthcounts code points when typing (CodePointLengthFilter).LengthFiltercounted UTF-16 units, so an emoji took two places.setInputTypereset it to 0 (RN#38676).Tests
New
example/__tests__/nitro-input-issues.harness.tsxreplays 23 issue reproductions:animationvalues; a push with the keyboard down; formSheet; action sheet after blur or unmount; pop with a field on the covered screen.onChangeText;maxLengthon programmatic values, huge values and emoji; lone surrogates; value and selection set together; selection set before focus; re-setting text after a clear; prop changes while focused;selectTextOnFocus; fast mount/focus/unmount churn.The keyboard suite gains a focus-from-effect test.
bun run test:harness:ios(iPhone 17 simulator): 118/118bun run test:harness:android-device(Galaxy A22): 116/116; the two action-sheet tests are iOS-onlybun run typecheck🤖 Generated with Claude Code