Skip to content
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
merged 8 commits into from
Apr 2, 2024

Conversation

TatianaKapos
Copy link
Contributor

@TatianaKapos TatianaKapos commented Apr 1, 2024

Description

Fixes OnSelectionChanged running multiple times because of extra calls from UpdateState when first created.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

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

@@ -1123,19 +1121,11 @@ void WindowsTextInputComponentView::updateState(
m_comingFromState = true;
// Only handle single/empty fragments right now -- ignore the other fragments

LRESULT res;
Copy link
Contributor Author

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 TatianaKapos marked this pull request as ready for review April 2, 2024 22:03
@TatianaKapos TatianaKapos requested a review from a team as a code owner April 2, 2024 22:03
@TatianaKapos TatianaKapos changed the title [Draft] Fix OnSelectionChanged running multiple times [Fabric] Fix OnSelectionChanged running multiple times Apr 2, 2024
@TatianaKapos TatianaKapos merged commit 187f3a6 into microsoft:main Apr 2, 2024
52 checks passed
@TatianaKapos TatianaKapos deleted the tk-textinput-multiple branch April 2, 2024 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants