Headless Listbox crashing with minor customisation #4448
-
Would like to use headless listbox. Unfortunately very minor customisation is causing it to crash. Its exactly the same as the example on the website (https://alpinejs.dev/component/headless-listbox), only difference is adding that getter filteredFrameworks to remove currently selected framework from the list of options. Here is the reproduction - https://jsfiddle.net/0fanjg27/ . Any suggestion how to work around it or ideally fix that bug? ![]() |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Basically, since you're filtering like that, the element won't be in the listbox anymore, so it won't have the refs. I'd recommend for such a case, to just use an x-show on the options. |
Beta Was this translation helpful? Give feedback.
Basically, since you're filtering like that, the element won't be in the listbox anymore, so it won't have the refs.
I'd recommend for such a case, to just use an x-show on the options.