shoelace-style / shoelace

A collection of professionally designed, every day UI components built on Web standards. SHOELACE IS BECOMING WEB AWESOME 👇👇👇
https://webawesome.com
MIT License
12.83k stars 819 forks source link

sl-input autofocus doesn't work when input is contained in a sl-tab-panel #2216

Open chrisjameslennon opened 4 days ago

chrisjameslennon commented 4 days ago

Describe the bug

sl-input autofocus doesn't work when input is contained in a sl-tab-panel

To Reproduce

Steps to reproduce the behavior:

  1. place a sl-tab-group and panel on the page, following the example given in the shoelace.style documentation
  2. place an sl-input in the tab group e..g <sl-input autofocus="true> 3.load the page
  3. sl-input control doesn't receive the focus on page load

Browser / OS

KonnorRogers commented 3 days ago

I believe this to be a problem with autofocus in general on our components, not necessarily within <sl-tab-group>.

https://github.com/shoelace-style/shoelace/issues/2000

reproduction:

https://codepen.io/paramagicdev/pen/bGXWoga?editors=1000