Skip to content

Conversation

@SimoTod
Copy link
Collaborator

@SimoTod SimoTod commented May 26, 2024

Currently a tab gets the focus when you receive the mousedown event instead of the full click.
This is different from how tabs usually work everywhere else (including Tailwind Headless UI that fixed it with this PR: tailwindlabs/headlessui#1192).

Unfortunately, it's not easily testable because cypress doesn't behave that way but chrome and firefox do.

This seem to cause some interoperability issues with x-dialog too: #4230 (reply in thread) (The OP didn't provide an example though).

@calebporzio
Copy link
Collaborator

Ah this makes total sense and the mousedown prevention listener is a nice solution - I didn't know that would prevent focus but it makes sense.

I'm gonna use that in other situations too.

Thanks simone!

@calebporzio calebporzio merged commit 1927cb1 into alpinejs:main May 28, 2024
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.

2 participants