Skip to content

fix: support OTP digit editing and resolve input regressions - #118

Open
Leolijiaming wants to merge 1 commit into
anday013:mainfrom
Leolijiaming:codex/fix-otp-editing-and-issue-regressions
Open

Leolijiaming wants to merge 1 commit into
anday013:mainfrom
Leolijiaming:codex/fix-otp-editing-and-issue-regressions

Conversation

@Leolijiaming

Copy link
Copy Markdown

OTP cells could not select individual digits, placeholder cells incorrectly received filled styles, and the blinking cursor did not stop its animation on cleanup. All cells also shared the same default test identifier.

This change keeps the existing single TextInput and adds measured cell hit testing and selection synchronization so tapping a filled cell selects that character for replacement. Multi-character input updates the caret after insertion and guards against a subsequent pre-edit selection event, addressing the reported partial-paste/backspace scenario. Clear and programmatic assignment reset selection consistently, and native callbacks remain available.

The patch also bases filled styling on actual input, stops blink loops on cleanup and duration changes, sets animations to non-interactive, and derives optional per-cell test/native IDs from the existing textInputProps identifiers while retaining legacy defaults.

Fixes #114
Fixes #109
Fixes #104
Related to #105 and #113; native-device acceptance is still pending.

Validation:

  • 96 Jest tests and the component snapshot pass, including digit replacement, secure input, partial paste followed by deleting all digits, stale selection event ordering, repeated digits, RTL cell bounds, native range selection, and custom callbacks.
  • TypeScript check, production build, Prettier checks on changed TypeScript files, and git diff --check pass.
  • No iOS simulator runtime was installed on the development machine. The iOS 18.6.2 report in Backspace not deleting code #113 has not been reproduced or verified on a native device; event-level tests do not establish a complete native fix.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

filledPinCodeContainerStyle applies when placeholder is used but value empty VerticalStick blocking InteractionManager Provide unique IDs & testIDs

1 participant