const filter = async (value: string) => {
// current active item
const current = state.active === -1
? state.selected
: state.items[state.active].value
I'm running into a bug where state.active is undefined. (Refer to the first value in the console log screenshot.)
I can reproduce this reliably. It happens on a fresh page refresh when I start entering an input in a combobox for the first time. The second time (after exiting and refocusing the combobox), it works correctly.
Apparently, it was caused by something I did on my end. Turns out, if you set $combobox.selected = null, you also need to set $combobox.active = 0. Otherwise, that error happens.
In this filter function:
I'm running into a bug where
state.active
is undefined. (Refer to the first value in the console log screenshot.)I can reproduce this reliably. It happens on a fresh page refresh when I start entering an input in a combobox for the first time. The second time (after exiting and refocusing the combobox), it works correctly.
I believe it can be fixed with this change:
It will default to the first item if
state.active
is undefined.