Comments (3)
Thanks for reporting that.
I'm not sure why we explicitly allow for object
to be focusable according to our tree walker. They don't appear to be focusable on their own in plain HTML
https://jsfiddle.net/v0c2kn5L/8/
It looks like they aren't focusable by keyboards even if a tab index is specified. They can be programmatically focused, but would need a tabIndex >= 0
I'll see if anyone on the team remembers more about this line
from react-spectrum.
It looks like what needs to be done to check if an element is focusable/tabbable is a lot more complex than it seems vs. the checks in getFocusableTreeWalker()
: https://allyjs.io/data-tables/focusable.html#object-element
In the specific case of RadioGroup though, I think the code could be amended to solely walk the tree for preceeding/proceeding <Radio/>
items based on my cursory read of the ARIA RadioGroup spec.
https://www.w3.org/WAI/ARIA/apg/patterns/radio/
For Radio Groups Not Contained in a Toolbar
- Right Arrow and Down Arrow: move focus to the next radio button in the group, uncheck the previously focused button, and check the newly focused button. If focus is on the last button, focus moves to the first button.
- Left Arrow and Up Arrow: move focus to the previous radio button in the group, uncheck the previously focused button, and check the newly focused button. If focus is on the first button, focus moves to the last button.
For Radio Group Contained in a Toolbar
- Right Arrow:
When focus is on a radio button and that radio button is not the last radio button in the radio group, moves focus to the next radio button.
When focus is on the last radio button in the radio group and that radio button is not the last element in the toolbar, moves focus to the next element in the toolbar.
When focus is on the last radio button in the radio group and that radio button is also the last element in the toolbar, moves focus to the first element in the toolbar.- Left Arrow:
When focus is on a radio button and that radio button is not the first radio button in the radio group, moves focus to the previous radio button.
When focus is on the first radio button in the radio group and that radio button is not the first element in the toolbar, moves focus to the previous element in the toolbar.
When focus is on the first radio button in the radio group and that radio button is also the first element in the toolbar, moves focus to the last element in the toolbar.- Down Arrow (optional): Moves focus to the next radio button in the radio group. If focus is on the last radio button in the radio group, moves focus to the first radio button in the group.
- Up Arrow (optional): Moves focus to the previous radio button in the radio group. If focus is on the first radio button in the radio group, moves focus to the last radio button in the group.
from react-spectrum.
Thanks for reporting that. I'm not sure why we explicitly allow for
object
to be focusable according to our tree walker. They don't appear to be focusable on their own in plain HTMLhttps://jsfiddle.net/v0c2kn5L/8/ It looks like they aren't focusable by keyboards even if a tab index is specified. They can be programmatically focused, but would need a tabIndex >= 0
I'll see if anyone on the team remembers more about this line
It was more relevant in the age of plugins, but object tags are focusable depending on the element being rendered.
from react-spectrum.
Related Issues (20)
- RAC ComboBox isReadOnly does not disallow selections when menuTrigger is set to focus HOT 1
- Duplicate keys in collections when rendering in tests with React 17
- Focus Ring not disappearing in pointer input mode HOT 5
- RAC NumberField validation broken in next.js HOT 2
- RAC Datepicker should not submit value when disabled HOT 2
- OverlayTriggerStateContext is null when used within the RAC Select HOT 1
- RAC `Input` `defaultValue` causes error HOT 2
- RAC Menu usability issue on mobile due to lack of tray feature HOT 1
- From Collection.mjs : use-sync-external-store/shim/index.js doesn't provide an export named: 'useSyncExternalStore' HOT 3
- Typosquatting on react-aria/toast? HOT 1
- RAC `Slider` causes "No label associated with a form field" issue HOT 3
- [useTablist] tabpanel elements are not focusable when layout differs as per docs HOT 7
- Submenu doesn't open on arrow key when using typeahead to select it if keypresses are made once it's already been focussed HOT 4
- Default value for `placement` prop in RAC Tooltip docs should be `'top'` instead of `'bottom'` HOT 1
- Textfield validation icon is clipped out of the box HOT 1
- useListState is entering infinite loop after removing last focused item that is not disabled HOT 2
- useSliderThumb - excludeFromTabOrder won't modify the tabIndex HOT 4
- React Suspense components wrapped in Provider emit runtime errors when using SSR HOT 1
- Video Controls are not respected when using FocusScope HOT 5
- The code inside `<script>` element rendered by `<LocalizedStringProvider>` doesn't run on Next.js `not-found.js` page HOT 3
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.