-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix #6245 Select searchValue not changeable when value and searchValue are controlled #6272
Conversation
… value and search value controlled select when select option is set
It breaks dynamic data functionality. You can see that in "Data changes over time" story. Video of behavior differences: 2024-05-23.17.54.43.mov2024-05-23.17.55.58.mov |
Damn. Missed that because the tests were all looking good. Thanks for spotting this @rtivital. I will look into this again but I feel like the original behavior of that story was not appropriate either. In my opinion the selected option should get reset (to null/undefined) whenever the underlying data changes and the currently selected option is not part of the new dataset anymore. Setting the selected option to something else that came with the new dataset does not really make sense to me but I might be missing something so please correct me if you have different thoughts on that. |
Nevermind. After looking at the story again I noticed that the value stays the same and it's only the label that is changing. I guess then it's fine the way it is. |
Please check again @rtivital |
This is not a good solution, this makes |
Can understand your decision @rtivital. Do you have a better idea to fix this bug? |
Would you approve adding the logic/idea from |
No, it is a flawed logic even without the dependency. The comparison for deep equality will be performed at each render because data is not usually memoized, it will have a significant impact on performance for the large data sets. |
I again took some time to work on this and tried to figure out a better approach. Hope you will like this one now @rtivital. 🙂 |
Thanks! |
Fixes #6270
Fixes #6245