Skip to content

Commit

Permalink
Merge pull request #24 from wayfair-incubator/vpodk-focusable-elements
Browse files Browse the repository at this point in the history
Updated focusable elements list
  • Loading branch information
vpodk committed Mar 3, 2022
2 parents b03c2a9 + de26db7 commit 95e01ef
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-focus-bounder",
"version": "1.1.4",
"version": "1.1.5",
"description": "Focus looping component based on focus bounders.",
"homepage": "https://github.com/wayfair-incubator/react-focus-bounder",
"repository": "github:wayfair-incubator/react-focus-bounder",
Expand Down
7 changes: 6 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ const BOUNDER_LINK_CLASS_NAME = "FocusBounder-link";
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/:not
*/
const FOCUSABLE_ELEMENTS_SELECTORS = [
`a:not(.${BOUNDER_LINK_CLASS_NAME}):not([disabled])`,
// Links must have `href` attribute to be focusable.
`a[href]:not(.${BOUNDER_LINK_CLASS_NAME}):not([disabled])`,
// All items with `tabIndex` are focusable but must be >=0
"[tabindex]:not([tabindex=-1]):not([disabled])",
"[contenteditable]",
// Form elements:
"button:not([disabled]), input:not([disabled])",
"select:not([disabled]), textarea:not([disabled])",
];
Expand Down

0 comments on commit 95e01ef

Please sign in to comment.