-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Fabric] Fix OnSelectionChanged running multiple times #12903
Merged
TatianaKapos
merged 8 commits into
microsoft:main
from
TatianaKapos:tk-textinput-multiple
Apr 2, 2024
Merged
[Fabric] Fix OnSelectionChanged running multiple times #12903
TatianaKapos
merged 8 commits into
microsoft:main
from
TatianaKapos:tk-textinput-multiple
Apr 2, 2024
Conversation
This file contains 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
TatianaKapos
commented
Apr 2, 2024
@@ -1123,19 +1121,11 @@ void WindowsTextInputComponentView::updateState( | |||
m_comingFromState = true; | |||
// Only handle single/empty fragments right now -- ignore the other fragments | |||
|
|||
LRESULT res; |
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.
Removed this code because UpdateText calls the same messages. If these extra calls are needed, I can add them back!
TatianaKapos
changed the title
[Draft] Fix OnSelectionChanged running multiple times
[Fabric] Fix OnSelectionChanged running multiple times
Apr 2, 2024
marlenecota
approved these changes
Apr 2, 2024
jonthysell
approved these changes
Apr 2, 2024
chrisglein
approved these changes
Apr 2, 2024
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.
Description
Fixes OnSelectionChanged running multiple times because of extra calls from UpdateState when first created.
Type of Change
Why
reliability
What
Adds check for calls coming from UpdateState and removes some extra code that isn't necessary. Other than when the textinput is first created, I don't see any other calls from UpdateState that would need OnSelectionChanged to be run.
Screenshots / Testing
Paper:
https://github.com/microsoft/react-native-windows/assets/42554868/4a6f66b2-5155-4f17-89f3-f07c16421303
Before:
https://github.com/microsoft/react-native-windows/assets/42554868/b79f53b7-bcd5-4f32-bc44-0e6a4eb01332
After:
https://github.com/microsoft/react-native-windows/assets/42554868/5e854cf2-4b0c-4448-8453-dd5d5ebb627b
Tested locally and with change in snapshots
Changelog
no