rob-balfre / svelte-select

Svelte Select. A select component for Svelte
https://svelte-select-examples.vercel.app
Other
1.25k stars 175 forks source link

when setting focus programmatically using "focused=true" the tabindex order is not updated #674

Open ar4hc opened 3 months ago

ar4hc commented 3 months ago

I have a form with multiple selects in a row and then and a few button after them.

One of the buttons, say "do stuff" does stuff(tm) and then should set the focus on the 1. select again.

Something like

    function handleFocus() {
      focused = true;
      listOpen = true;
    }

works, kind of, and opens the list for keyboard and mouse navigation, but on tab press in the select the focus is on the button after the "do stuff" button i clicked to focus on the 1. select again.

I'd expect it to jump to the select right after the focuses select, not skipping to the button after the clicked button...

ar4hc commented 3 months ago

Another observation: setting the focus with "focused=true" shows the Select with the "focus:" CSS styles, even if another button is the "real" focus.

ar4hc commented 3 months ago

repl

ar4hc commented 1 month ago

bump ?