-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
[Combobox] ctrl+a in text input replaces selection when multiple=true
#499
Comments
I'll note that at first glance, it looks like either forcing Also, doing a quick search of the code base and docs, no To be clear, I think that this kind of behavior should opt-in by default if it's to exist at all, but considering that may be considered a breaking change, I'm fine enough with just being able to turn it off manually. Edit: Looking at things more closely, I missed this comment in the code: kobalte/packages/core/src/combobox/combobox-base.tsx Lines 677 to 689 in 7631960
"And while the developer can pass in their own KeyboardDelegate, it seems the purpose of that is only for navigation (though one could override the behavior to select as well I'm sure). The Is what I would say but the other defined behaviors of including the The only keyboard behavior I've observed while the keyboard is open is that tl;dr - The function that's supposed to add list keyboard handlers to the Combobox ( |
Describe the bug
Pressing
ctrl + a
replaces current selected values with that of all the visible items in the dropdown, even when text input is focused.To Reproduce
Steps to reproduce the behavior:
https://stackblitz.com/edit/github-1j1ryx-1vucsx?file=src%2Froutes%2Findex.tsx
(There are extra properties in the stackblitz that are not necessary to reproduce this behavior. It occurs in the docs examples as well.)
true
)ctrl+a
Expected behavior
When the text input field is focused,
ctrl + a
should only select (highlight) the text in the field. I can't think of any other behavior that should happen instead of, or in addition to this.Screenshots
chrome_5zPbe3hYTb.mp4
Desktop (please complete the following information):
Additional context
ctrl + a
is a common way to highlight all text in a focused input field for quickly deleting or replacing it. The Combobox input field behaves as this way (as expected) when the Comboxbox is not set tomultiple
. Whenmultiple
is set, the behavior changes to that explained above. There doesn't seem to be any way for a user to change this behavior.I'm not sure what I would expect if focus was instead inside of the dropdown list. In that case, I could maybe see the current behavior making sense (
ctrl + a
replacing the selected values with that of the visible items).Thumbing around a bit, I think it's related to
kobalte/packages/core/src/combobox/combobox-base.tsx
Line 678 in 7631960
kobalte/packages/core/src/selection/create-selectable-collection.ts
Lines 310 to 319 in 7631960
The text was updated successfully, but these errors were encountered: