Open kimskovhusandersen opened 1 week ago
It seems the same issue might exist in the single select as well.
@wingkwong can I work on this issue?
It looks like there are some other problems also. in the popover component of select, keyDown event's behavior works differently for different cases.
1) if a value is already selected -> only the keys other than enter and escape trigger a keyDown -> pressing escape resets the state without triggering keydown -> pressing enter on new value simply sets the new value. -> pressing enter on same value resets the select's value and does not trigger keydown
2) if no value is selected -> keys other than enter trigger the keyDown (even Escape key triggers it) -> pressing the enter sets a value.
NextUI Version
2.4.8
Describe the bug
When the Escape key is pressed while the select dropdown is open, all selected options are deselected. This behavior is unexpected, as the Escape key should ideally close the dropdown without affecting the selections.
Your Example Website or App
No response
Steps to Reproduce the Bug or Issue
Open the select dropdown. Select one or more options (if multi-select). Press the Escape key while the dropdown is open.
Expected behavior
Pressing the Escape key should close the dropdown without changing the selected options.
Screenshots or Videos
https://github.com/user-attachments/assets/a898ea65-5998-4601-a75f-dd61d687dc2d
Operating System Version
macOS
Browser
Chrome