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

Feature request: Focus management #33

Open
joe-watkins opened this issue Mar 19, 2017 · 4 comments
Open

Feature request: Focus management #33

joe-watkins opened this issue Mar 19, 2017 · 4 comments

Comments

@joe-watkins
Copy link

Hello :) Great work here!

I'd like to recommend the idea of focus management for your plugin. It would look something like this:

  1. User clicks on toggle.
  2. After the target is expanded send focus to the target element. May have to add tabindex="-1" to target so it can receive focus.
  3. If the target is already visible, maintain focus on the toggle and hide target.

What ya think?

@KittyGiraudel
Copy link
Collaborator

I like the idea, I just wonder if it’s a good one (in the sense that I wonder if focus change would be expected). Ping @Heydon & @ffoodd.

@joe-watkins
Copy link
Author

@hugogiraudel Tnx :) Maybe an optional feature might be the way to go?

Here's an example pattern from W3C WAI-ARIA

@ffoodd
Copy link

ffoodd commented Mar 20, 2017

Hi there,

My two cents: I think it's a good idea as an option.

The most common way to use a toggle is that hidden content follows the trigger (DOM speaking). This way, appearing content becomes next content in the flow — and if any focusable element inside, it naturally appears in the focus flow too.

But if for any reason the toggled content is anywhere else in the DOM, I think it's better to move focus to the toggled content (same arguments than with the dialog pattern) as recommended by @joe-watkins.

@dennisfrank
Copy link

dennisfrank commented Nov 16, 2017

Hi. Sorry, I am not a bigger help right now. But this would be the number one feature addition I would love to see! :)

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

No branches or pull requests

4 participants