Closed joepetrakovich closed 1 year ago
You can create your own hover event in the item named slot. That should work
On Wed, 4 Jan 2023, 12:55 pm Joe Petrakovich, @.***> wrote:
I was expecting hoverItem to be called when I hover any item but it doesn't work if you only have one item. I'm assuming because the hoverIndex defaults to the first item.
Is there any way around that? I'd like the event to fire whenever an item is hovered.
<Select {items} on:hoverItem={(e) => {console.log(e)}} />
— Reply to this email directly, view it on GitHub https://github.com/rob-balfre/svelte-select/issues/512, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUAM7SE55IQJSRY27ZCS7TWQTKBRANCNFSM6AAAAAATQI2Q6Y . You are receiving this because you are subscribed to this thread.Message ID: @.***>
That'll work. I assume you mean via mouseenter/mouseleave events on the slot?
yeah and a focus event.
Got it! Thanks for the idea, that'll work perfectly.
I was expecting
hoverItem
to be called when I hover any item but it doesn't work if you only have one item. I'm assuming because the hoverIndex defaults to the first item.Is there any way around that? I'd like the event to fire whenever an item is hovered.