-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Provide a general summary of the issue here
react-aria-components ComboBox will be called first when option is selected and then one or two times again when focus is changed from component.
If the focus is removed by clicking somewhere else in the app, then there is 1 extra onSelectionChange call.
If the focus is removed by pressing tab, then there is 2 extra onSelectionChange calls.
This happens when fully controlled is used so that both selectedKey and inputValue are used.
π€ Expected Behavior?
There should not be any extra onSelectionChange calls when focus is removed.
My core problem is that I want to reset selection when the same option is selected again but these extra onSelectionChange calls prevent me for adding this logic there.
π― Current Behavior
There are 1 or 2 extra onSelectionChange calls when focus is removed.
π Possible Solution
No response
π¦ Context
No response
π₯οΈ Steps to Reproduce
Here is codesandbox. Select option from combobox and press tab or mouse somewhere else and you can see the Call Count increased.
https://codesandbox.io/p/sandbox/tz7qjv
Version
react-aria-components 1.15.1
What browsers are you seeing the problem on?
Firefox, Chrome
If other, please specify.
No response
What operating system are you using?
Windows 10
π§’ Your Company/Team
No response
π· Tracking Issue
No response