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

feat(Dropdown): add a11y prop to tab moves focus #1600

Merged
merged 1 commit into from Oct 3, 2019

Conversation

TheSharpieOne
Copy link
Member

This adds a new a11y prop to Dropdrop, defaults to true.
When the a11y prop is explicitly set to false:
This changes the way tab works within the Dropdown.
tab/shift-tab will move focus to the next logic item:
tab will move down until the end. Then, at the end of the menu it will focus the next focusable item on the page and close the menu.
shift-tab will move up until the start. Then, at the beginning of the menu it will focus the toggle and close the menu.

Fixes #1441

  • Bug fix
  • New feature
  • Chore
  • Breaking change
  • There is an open issue which this change addresses
  • I have read the CONTRIBUTING document.
  • My commits follow the Git Commit Guidelines
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

This adds a new a11y prop to Dropdrop, defaults to true.
When the a11y prop is explicitly set to false:
This changes the way tab works within the Dropdown.
tab/shift-tab will move focus to the next logic item:
tab will move down until the end. Then, at the end of the menu it will focus the next focusable item on the page and close the menu.
shift-tab will move up until the start. Thenm, at the beginning of the menu it will focus the toggle and close the menu.

Fixes #1441
@TheSharpieOne TheSharpieOne merged commit 1bd965f into master Oct 3, 2019
@TheSharpieOne TheSharpieOne deleted the feat/iss-1441 branch October 3, 2019 12:43
@rhdtl78
Copy link

rhdtl78 commented Oct 18, 2019

I faced the warning with a11y attribute on dropdown.

Warning: Received true for a non-boolean attribute a11y.

If you want to write it to the DOM, pass a string instead: a11y="true" or a11y={value.toString()}.
in div (created by Dropdown)
in Manager (created by Dropdown)
in Dropdown ...

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.

Dropdown accessibility - tab key
2 participants