Comments (3)
See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-hidden
aria-hidden="true" should not be used on elements that can receive focus. Additionally, since this attribute is inherited by an element's children, it should not be added onto the parent or ancestor of a focusable element.
from react-spectrum.
Can you tell us more about your usecase? @rostero1 is correct, in general it shouldn't be used on a button. Though I'd expand on it and say most of the time, even if it can't receive focus, it still shouldn't be hidden. As an example, look at our Combobox and NumberField, their in-field buttons are not included in the tab focus order, but they are not hidden so that Assitive Technology users can still interact with them.
If you can show us an example of what you're trying to accomplish, we may be able to provide some recommendations that hopefully don't involve aria-hidden.
from react-spectrum.
Assuming there is valid use case to remove the button from the accessibility tree but not from the DOM - the inert
attribute might be the right choice?
Usually I find myself wanting aria-hidden in situations where something is behind a modal overlay or similarly intentionally not available.
from react-spectrum.
Related Issues (20)
- Breadcrumbs should not automatically add aria-current="true" to last item HOT 3
- RAC: Controlled state nested tabs don't work HOT 1
- In Async combobox while i scroll to end and starts searching again getting white space at the bottom of list box HOT 2
- Tree crashes when trying to set `expandedKeys = "all"` HOT 1
- The Radio from react-aria-components is missing excludeFromTabOrder prop HOT 15
- ListBox with selectionMode="multiple" not working inside Combobox component HOT 2
- useTooltipTrigger's trigger props do not work when used with useButton HOT 1
- Code mismatch in published packages & github repo HOT 4
- Cannot build repository HOT 5
- ColorSwatch does not apply UNSAFE_className HOT 2
- Improve DatePicker to Allow Navigation to Months With All Dates Disabled HOT 1
- Search and path params in TanStack Router incompatible with `useHref` HOT 10
- [TreeView] parent/child selectionBehavior HOT 1
- DateField could offer to cycle time beyond focused segment with arrow up/down HOT 8
- mergeProps doesn't work for Server Components HOT 1
- Getting white space while scroll to the bottom of the combobox HOT 3
- Thoughts on Collection API consistency HOT 9
- Combobox crashes on ios 18 (childNodes is not supported) HOT 3
- Uncontrolled RAC TextField does not restore value on browser tab restoration
- Popover with `<input autoFocus/>` scrolls to bottom HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-spectrum.