Skip to content

Bug(1023872) - SfOtpInput Fails to AutoFill OTP from System OneTime Code Suggestion#360

Closed
KarthikaRSF4617 wants to merge 1 commit into
mainfrom
bug/otpinput-paste-fix
Closed

Bug(1023872) - SfOtpInput Fails to AutoFill OTP from System OneTime Code Suggestion#360
KarthikaRSF4617 wants to merge 1 commit into
mainfrom
bug/otpinput-paste-fix

Conversation

@KarthikaRSF4617
Copy link
Copy Markdown
Collaborator

@KarthikaRSF4617 KarthikaRSF4617 commented May 12, 2026

Bug Description

On iOS devices, when the OTP is autofilled using the system-provided “One-Time Code” suggestion, the OTP input control does not function as expected. The autofill behavior fails to correctly manage focus transitions and does not properly aggregate the complete OTP value across all input fields.
As a result:

  • The OTP fields may appear partially filled.
  • Focus does not move correctly between input fields during autofill.
  • The final OTP value is not correctly captured.

Root Cause

  • On iOS, when OTP is autofilled using the system “One‑Time Code” suggestion, the control was not properly updating focus and final value aggregation.
  • The existing implementation only updated the current field (_focusedIndex) without:
  • Moving focus to the next field correctly.
  • Recomputing the full OTP value when all fields are populated.
  • As a result, the OTP autofill appeared partially filled or did not trigger completion logic.

Solution description

To handle iOS autofill scenarios correctly, the following changes were introduced:

  • Focus Handling After Text Update
  • Added iOS-specific logic after updating the entry value:
  • Final OTP Value Aggregation for Autofill
  • Added logic to detect when all fields are filled and concatenate values:

Issue Fixed:

#343

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.

1 participant