Closed Gotenks-J closed 2 days ago
Oooo thats a good catch!
Ill have to look into that. im guessing it has something to do with search that does data replacement based upon search results.
I have a few other things I need to finish up but if i get some time ill try to see if i can fix this.
If you think you can fix it. Git clone, npm install, npm run dev.
I think a better solution here is to set the id
for options returned by the search
event, this fixes the issue for me, e.g https://codepen.io/GotenksJ/pen/YzmregP
Maybe it's just a matter of updating the documentation to describe this, I think it's reasonable that the user is expected to set the id
attribute when using search
otherwise they're at the mercy of the ID generator.
Working example after updating the docs to set the id
attribute:
https://github.com/user-attachments/assets/149d6788-38d8-4070-98da-7137840c199b
If you're happy with this I can look at updating the documentation to include this?
I can definitly see where your coming from but an id should be set no matter what even if it came from search cause i dump that into data right after.
i have some time tonight let me see if i can stare at that part for a sec
Closing this in favour of a better solution or we will resolve this by setting the ID attribute
Describe the bug
After deselecting an option, then selecting the same option when using the
search
event does not select itPotentially related to: https://github.com/brianvoe/slim-select/pull/555
Recreate it in Codepen
https://codepen.io/GotenksJ/pen/gOVWbzr
I was lazy with the Codepen and instead of using an API that returns the same data on each call I just set the options on search.
To Reproduce
Steps to reproduce the behavior:
https://github.com/user-attachments/assets/1b37cac3-adf0-4146-885a-f8c922e12a91
You can also see this issue in the documentation of the
search
event:https://github.com/user-attachments/assets/a7b3a1e7-2b8a-49ed-9c9d-56948477cf66