-
-
Notifications
You must be signed in to change notification settings - Fork 200
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
Hitting enter adds a new item instead of selected item when searching (when addable is enabled) #594
Comments
That is a good catch. Basically what needs to happen is if they press down set a variable to indicate to not add and if they start typing. reset it to add again. |
word, are you suggesting to do that on my side as part of the search logic? or as a fix for the lib internally |
That would need to be done in slim select. If you want to submit a pr I can get it in much quicker. |
Sounds good, I'll see if I can get to it in the next few days. From a quick glance it looks like this is the line where we would need to take into consideration whether the user has typed or not? slim-select/src/slim-select/render.ts Lines 692 to 695 in 373c543
|
yep |
Describe the bug
I have
addable
enabled to allow creation, however if I do a partial search -> hit down arrow to select the item -> hit enter -> the partial search is created rather than the selected item added.I would expect the item selected via the down arrow to be the one selected and not and item created.
Below is a code pen and a video reproducing the issue. Let me know if you need any more details, thanks!
Recreate it in Codepen
https://codepen.io/stv8/pen/MYgGeEB
To Reproduce
Steps to reproduce the behavior:
CleanShot.2025-01-13.at.10.22.14.mp4
The text was updated successfully, but these errors were encountered: