Fix SMS autofill by using single text field#789
Open
William-Laverty wants to merge 1 commit intoXcodesOrg:mainfrom
Open
Fix SMS autofill by using single text field#789William-Laverty wants to merge 1 commit intoXcodesOrg:mainfrom
William-Laverty wants to merge 1 commit intoXcodesOrg:mainfrom
Conversation
The previous implementation used 6 separate text fields for the SMS verification code, which broke macOS's built-in SMS autofill functionality. When the system detects an SMS code and offers to autofill it, it expects a single text field to receive the entire code. Changes: - Replaced 6 individual PinCodeCharacterTextField instances with a single NSTextField - Added .oneTimeCode content type to enable SMS autofill on macOS 11+ - Simplified the code structure while maintaining the same functionality - Added input validation to ensure only digits are accepted Now when users receive an SMS verification code, macOS can properly autofill the entire code with a single click, rather than filling only the first digit and deleting the message. Closes XcodesOrg#788
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.
Summary
Fixes the SMS autofill issue where macOS would only fill the first digit of the verification code.
Problem
The previous implementation used 6 separate
NSTextFieldinstances (viaPinCodeCharacterTextField) for the SMS verification code input. When macOS detects an SMS code and offers to autofill it, it expects a single text field to receive the entire code.With the old implementation:
Solution
Replaced the 6 individual text fields with a single
NSTextFieldthat:.oneTimeCodecontent type set (macOS 11+) to enable SMS autofillChanges
.oneTimeCodecontent typeTesting
Note
I was unable to test the build locally due to a pre-existing package resolution issue (
AsyncHTTPNetworkServicerepository not found), but the changes are straightforward and syntactically correct.Closes #788