Skip to content

u-tabs: If focusable element is not first in the DOM, the panel gets focus #33

@Barsnes

Description

@Barsnes

Use this to reproduce:

<u-tabs>
  <u-tablist>
    <u-tab>Tab 1</u-tab>
    <u-tab>Tab 2</u-tab>
  </u-tablist>
  <u-tabpanel><button>123</button>Panel 1 with <a href="#">link</a></u-tabpanel>
  <u-tabpanel>Panel 2 with <a href="#">link</a></u-tabpanel>
</u-tabs>
<style>
  /* Styling just for example: */
  u-tab { padding: .5em }
  u-tab[aria-selected="true"] { border-bottom: 4px solid }
  u-tabpanel { padding: 1em; border: 1px solid }
</style>

When you tab inside the first tab, the button gets focus. On the second one, the panel gets focus before the link

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions