-
Notifications
You must be signed in to change notification settings - Fork 524
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
How can I programmatically change focus with ref? Or at least change a tabIndex order? #1917
Comments
@alexfrize Thanks for calling out this issue! I have run into similar issues with refs, so perhaps we can work on some enhancements in order to better support refs and tabIndex props. At the moment, only the props that are documented for each victory component are getting passed through to the underlying svg component. For now, you can work around this by using the custom component props on <VictoryBar dataComponent={<Bar pathComponent={<path tabIndex={1} ref={ref} />} />} /> It also appears that the |
Thank you! |
|
There's not anything built into Victory to do this, but you can pass arbitrary properties into the |
Bugs and Questions
Checklist
This is not a
victory-native
specific issue. (Issues that only appear invictory-native
should be opened here)I have read through the FAQ and Guides before asking a question
I am using the latest version of Victory
I've searched open issues to make sure I'm not opening a duplicate issue
The Problem
This question is about accessibility.
Here is the code:
https://codesandbox.io/s/angry-hermann-13md9
Currently when the user presses TAB multiple times here is what happens: focus changes to a border then to a button inside, then another border. And after all the borders and buttons it starting to set focus on bars inside the border.
How can I change the logic to change it to this:
border->internal bar->button
Or, even better: border->border-> border, but when the user press ENTER on any border, it should focus on the internal bar (element inside the border).
Reproduction
https://codesandbox.io/s/angry-hermann-13md9
In the example above refs I currently have:
barRef_VictoryBar.current does not have a focus() method,
and barRef_Bar.current is null (initial value)
The text was updated successfully, but these errors were encountered: