-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle update of secureTextEntry
of TextInput
in iOS
#18587
Conversation
Perhaps document that this is a "hack". For the rest, I'm just glad to see this working, but can't help but think that this should be fixed elsewhere. </two_cents> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a setter for secureTextEntry instead of using didSetProps? Something like:
- (void)setSecureTextEntry:(BOOL)secureTextEntry
{
[super setSecureTextEntry:secureTextEntry];
...
}
Also I agree we should add a comment about what this does and a link to the SO post.
Hey @janicduplessis, thank you for reviewing. Where exactly should I put it? Do I have to add it and listen to the prop changes somewhere? |
@janicduplessis: can you take a look? :) |
This comment has been minimized.
This comment has been minimized.
@janicduplessis: would you mind taking a look? :) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@shergin: perhaps you can take a look at this? |
This comment has been minimized.
This comment has been minimized.
By Facebook team, they were probably referring to me as I was busy with some other tasks around that time (April). Looking at this PR, I see @janicduplessis already reviewed it and provided some feedback that doesn't seem to be addressed yet. |
@hramos: I'm waiting for a reply on this: #18587 (comment). I just need to know where to put the code specified by @janicduplessis. |
This comment has been minimized.
This comment has been minimized.
Looks like the review feedback hasn't been addressed yet. I know there's a question out to Janic on how the feedback should be implemented, but that's not for me to answer. I'll add that this PR would greatly benefit from adding a test case. |
Closing in favor of the new PR. |
Summary: This is a fix for #5859, based on the feedback in #18587. Instead of using `didSetProps` it uses a setter. I will also note that setting to `nil` no longer works (crashes) so setting it to a blank string then back to the original works fine. [iOS] [Fixed] - Toggling secureTextEntry correctly places cursor. Pull Request resolved: #23524 Differential Revision: D14143028 Pulled By: cpojer fbshipit-source-id: 5f3203d56b1329eb7359465f8ab50eb4f4fa5507
Summary: This is a fix for #5859, based on the feedback in #18587. Instead of using `didSetProps` it uses a setter. I will also note that setting to `nil` no longer works (crashes) so setting it to a blank string then back to the original works fine. [iOS] [Fixed] - Toggling secureTextEntry correctly places cursor. Pull Request resolved: #23524 Differential Revision: D14143028 Pulled By: cpojer fbshipit-source-id: 5f3203d56b1329eb7359465f8ab50eb4f4fa5507
This PR fixes #5859, which causes the
TextInput
to have a space appended to the end when you change the value ofsecureTextEntry
prop in iOS:I found a few workarounds online and the simplest one in my opinion is this SO answer.
I'm definitely open to hear more opinions on the implementation.
Test Plan
My test plan is very basic, having a
<TextInput />
and dynamically switchingsecureTextEntry
prop betweentrue
/false
will show the bug.Release Notes
[IOS] [BUGFIX] [Libraries/Text/TextInput/RCTBaseTextInputView.m] - Fix bug with space being appended to the end of input value when changing
secureTextEntry
.