-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Controlled TextInput doesn't work most of the time #7658
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
Conversation
|
Wow this one is nasty... Are we still actively investing in adding UI tests to RNTester examples? |
|
@NickGerleman Yes, it's still on my to-do list. |
|
@acoates-ms the <TextInput
onChangeText={text => {
text = text.replace(/ /g, '_');
this.setState({text});
}}
value={this.state.text}
/>where |
|
@rectified95 yes that example seems to work with these changes. |
|
Hello @acoates-ms! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
I think test coverage will have to be a bit of a group effort. We just have too much untested code to do otherwise. I think it would be valuable if we started adding coverage when fixing native control bugs. I think we're at the point where the framework should allow testing the sort of scenario this PR addresses without too much burden. |
|
OTOH there's definitely been times in the past where I felt like adding too scope (adding tests) would make a fix take too long for me to take on. Maybe we can do something to reduce that initial barrier. |
* If initial value is set, updated TextInput.value changes will not be reflected * Change files * default member initializers for bit-fields requires at least '/std:c++latest'
Fixes #7638.
JS was not providing the mostRecentEventCount back to native. So in
TextInputShadowNode::SetText, this condition would never be true,m_mostRecentEventCount == m_nativeEventCount, so any updated text value coming from JS would always be ignored.Microsoft Reviewers: Open in CodeFlow