We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://github.com/adobe/react-spectrum/blob/2e9061df69eb17f17b0fb7d64d318c2835aed145/packages/%40react-aria/utils/src/isFocusable.ts
FOCUSABLE_ELEMENT_SELECTOR
input:not([disabled]):not([type=hidden]):not([hidden]), select:not([disabled]):not([hidden]), textarea:not([disabled]):not([hidden]), button:not([disabled]):not([hidden]), a[href]:not([hidden]), area[href]:not([hidden]), summary:not([hidden]), iframe:not([hidden]), object:not([hidden]), embed:not([hidden]), audio[controls]:not([hidden]), video[controls]:not([hidden]), - [contenteditable]:not([contenteditable^="false"]), // actual: missing `:not([hidden])` + [contenteditable]:not([contenteditable^="false"]):not([hidden]), // expected [tabindex]:not([disabled]):not([hidden])
TABBABLE_ELEMENT_SELECTOR
input:not([disabled]):not([type=hidden]):not([hidden]):not([tabindex="-1"]), select:not([disabled]):not([hidden]):not([tabindex="-1"]), textarea:not([disabled]):not([hidden]):not([tabindex="-1"]), button:not([disabled]):not([hidden]):not([tabindex="-1"]), a[href]:not([hidden]):not([tabindex="-1"]), area[href]:not([hidden]):not([tabindex="-1"]), summary:not([hidden]):not([tabindex="-1"]), iframe:not([hidden]):not([tabindex="-1"]), object:not([hidden]):not([tabindex="-1"]), embed:not([hidden]):not([tabindex="-1"]), audio[controls]:not([hidden]):not([tabindex="-1"]), video[controls]:not([hidden]):not([tabindex="-1"]), [contenteditable]:not([contenteditable^="false"]):not([hidden]):not([tabindex="-1"]), - [tabindex]:not([tabindex="-1"]):not([disabled]) // actual: missing `:not([hidden])` + [tabindex]:not([tabindex="-1"]):not([disabled]):not([hidden]) // expected
const focusableElements = [ 'input:not([disabled]):not([type=hidden])', 'select:not([disabled])', 'textarea:not([disabled])', 'button:not([disabled])', 'a[href]', 'area[href]', 'summary', 'iframe', 'object', 'embed', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable^="false"])', '[tabindex]:not([disabled])' ]; const FOCUSABLE_ELEMENT_SELECTOR = focusableElements .map(selector => `${selector}:not([hidden])`) .join(","); const TABBABLE_ELEMENT_SELECTOR = focusableElements .map(selector => `${selector}:not([hidden]):not([tabindex="-1"])`) .join(","); export function isFocusable(element: Element): boolean { return element.matches(FOCUSABLE_ELEMENT_SELECTOR); } export function isTabbable(element: Element): boolean { return element.matches(TABBABLE_ELEMENT_SELECTOR); }
No response
Other
The text was updated successfully, but these errors were encountered:
FocusScope calls isElementVisible as well, but perhaps these standalone utils should do that too.
isElementVisible
react-spectrum/packages/@react-aria/focus/src/isElementVisible.ts
Line 62 in 2e9061d
Sorry, something went wrong.
@jamiebuilds-signal in what context are you using isFocusable/isTabbable standalone?
isFocusable
isTabbable
No branches or pull requests
Provide a general summary of the issue here
https://github.com/adobe/react-spectrum/blob/2e9061df69eb17f17b0fb7d64d318c2835aed145/packages/%40react-aria/utils/src/isFocusable.ts
FOCUSABLE_ELEMENT_SELECTOR
TABBABLE_ELEMENT_SELECTOR
🤔 Expected Behavior?
😯 Current Behavior
💁 Possible Solution
🔦 Context
No response
🖥️ Steps to Reproduce
Version
What browsers are you seeing the problem on?
Other
If other, please specify.
What operating system are you using?
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
The text was updated successfully, but these errors were encountered: