X Tutup
Skip to content

perf(TextField): optimize secureWithoutAutofill#11131

Merged
NathanWalker merged 2 commits intomainfrom
chore/types-improve
Mar 6, 2026
Merged

perf(TextField): optimize secureWithoutAutofill#11131
NathanWalker merged 2 commits intomainfrom
chore/types-improve

Conversation

@NathanWalker
Copy link
Contributor

@NathanWalker NathanWalker commented Mar 6, 2026

  • ensure input view properties are only updated when necessary, and to reload input views only when changes are made

@NathanWalker NathanWalker requested a review from CatchABus March 6, 2026 00:29
@nx-cloud
Copy link

nx-cloud bot commented Mar 6, 2026

🤖 Nx Cloud AI Fix Eligible

An automatically generated fix could have helped fix failing tasks for this run, but Self-healing CI is disabled for this workspace. Visit workspace settings to enable it and get automatic fixes in future runs.

To disable these notifications, a workspace admin can disable them in workspace settings.


View your CI Pipeline Execution ↗ for commit b48030b

Command Status Duration Result
nx test apps-automated -c=ios ❌ Failed 2m 41s View ↗
nx run-many --target=test --configuration=ci --... ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-06 16:25:17 UTC

nativeField.textContentType = typeof UITextContentTypeOneTimeCode !== 'undefined' ? UITextContentTypeOneTimeCode : '';
if (textField.textContentType !== undefined) {
const desiredTextContentType = typeof UITextContentTypeOneTimeCode !== 'undefined' ? UITextContentTypeOneTimeCode : '';
if (textField.textContentType !== desiredTextContentType) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all those tests can be simplified:
typeof UITextContentTypeOneTimeCode !== 'undefined' ? UITextContentTypeOneTimeCode : '' to UITextContentTypeOneTimeCode ?? ''
And everytime both if can be done into one with something like if (textField.textContentType !== undefined && textField.textContentType !== desiredTextContentType)
All that making the code more readable

Also i dont understand the desiredTextContentType defaulting to ''. Shouldnt it default to undefined. which would also simplify the if test (no need to compare with undefined`

All that would make the code far less verbose and much easier to understand/maintain

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NathanWalker I agree with @farfromrefug, this can be simplified a bit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@farfromrefug 💯 , pushed up simplification, much better. the textContentType empty string is not even needed. /cc @CatchABus

@NathanWalker NathanWalker merged commit 60baeea into main Mar 6, 2026
6 of 7 checks passed
@NathanWalker NathanWalker deleted the chore/types-improve branch March 6, 2026 18:17
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.

3 participants

X Tutup