Skip to content

fix(tabs): select automatic tabs on focus only, not on hover - #1263

Merged
maiieul merged 1 commit into
qwikifiers:mainfrom
maiieul:fix/tabs-automatic-hover
Nov 29, 2026
Merged

maiieul merged 1 commit into
qwikifiers:mainfrom
maiieul:fix/tabs-automatic-hover

Conversation

@maiieul

@maiieul maiieul commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

What is it?

  • Bug

Description

Closes #1253. With behavior="automatic", moving the pointer over a tab selected it while focus stayed on the tab the user had picked. Automatic tabs now select a tab when it gets focus only, as in the WAI-ARIA tabs pattern, and the Behavior section of the docs says what each mode does.

Breaking: apps that relied on hover selection lose it.

<Tabs.Root behavior="automatic">
  <Tabs.List>
    <Tabs.Tab>Maria</Tabs.Tab>
    <Tabs.Tab>Carl</Tabs.Tab>
  </Tabs.List>
  <Tabs.Panel>…</Tabs.Panel>
  <Tabs.Panel>…</Tabs.Panel>
</Tabs.Root>
Pointer over "Carl" while "Maria" is selected Selected tab
Before Carl
After Maria
tabs.test.ts
└─ Automatic behavior
   + the pointer passing over a tab doesn't select it: hovering "Carl" leaves "Maria" selected
   + a tab that gets focus from the keyboard is selected: ArrowRight from "Maria" selects "Carl"
   + a click on a tab selects it: clicking "Ida" selects "Ida"

@changeset-bot

changeset-bot Bot commented Nov 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ce85ebd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@qwik-ui/headless Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Nov 29, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/qwik-ui@1263
npm i https://pkg.pr.new/@qwik-ui/headless@1263
npm i https://pkg.pr.new/@qwik-ui/styled@1263
npm i https://pkg.pr.new/@qwik-ui/utils@1263

commit: ce85ebd

@maiieul
maiieul marked this pull request as ready for review November 29, 2026 20:49
@maiieul
maiieul merged commit b9bb4eb into qwikifiers:main Nov 29, 2026
6 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🐞] Tabs: in automatic mode, the pointer passing over a tab selects it

1 participant