Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$focus: Add 'onlyTabbables' modifier #3615

Closed
wants to merge 6 commits into from

Conversation

valincius
Copy link

This PR adds tabbables modifier to $focus plugin to allow traversing ONLY the tabbable elements.

@valincius
Copy link
Author

Failing tests are outside the scope of this PR.
If you'd like, I can address these in another PR.

@ekwoka
Copy link
Contributor

ekwoka commented Jun 8, 2023

What's the difference between a tabbable and a focusable?

@valincius
Copy link
Author

What's the difference between a tabbable and a focusable?

tabbable respects the tabindex

More info in their readme: https://github.com/focus-trap/tabbable

@SimoTod
Copy link
Collaborator

SimoTod commented Jun 8, 2023

What's the difference between a tabbable and a focusable?

an input with tabindex = -1 is focusable but not tabbable

@valincius isn't the syntax a bit inconsistent? focusables returns the list of focusable elements whilst tabbables returns this. I can already see people doing $focus.tabbables() and $focus.tabbable($el)

@valincius
Copy link
Author

valincius commented Jun 8, 2023

@SimoTod I went with this syntax to allow for reusing all of the other methods that build off of all and thus focusables so it wouldn't need duplication. I can see how this would be confusing though.

I will draft up something else.

Feel free to provide any suggestions.


What if I were to get rid of the tabbables method and instead you can specify you want tabbables only by using $focus.withTabbables()?

  • Or can keep tabbables and have it just call the tabbable.tabbables like you would expect.

@valincius
Copy link
Author

I've updated this to better fit the current api, could I get a review?

@valincius valincius changed the title $focus: Add 'tabbable' modifier $focus: Add 'onlyTabbables' modifier Jun 26, 2023
@calebporzio
Copy link
Collaborator

Thanks for contributing!

In order to keep Alpine as focused and maintainable as possible, I'm going to close this pull request.

This isn't "no", it's just "no for now".

If you disagree, or there's further demand from the community, please re-open this PR and we'll reconsider!

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.

None yet

4 participants