How to maintain keyboard navigability of data points when voiceover is enabled? #4662
-
When adding accessibilityLayer to a chart component, the points become navigable with the arrow keys, which is what is expected. However, when I enable voiceover (macos), the axes seem to hijack the navigability and the points are no longer accessible via keyboard navigation. As far as I can see this behavior is replicable by adding accessibilityLayer to the LineBarAreaComposedChart codesandbox and navigating first with voiceover off then on. The voiceover tool I'm using is the built in voiceover for MacOS. I'm not sure if I'm missing something when trying to navigate with the voiceover on or if this is intended or not. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 5 replies
-
same issue |
Beta Was this translation helpful? Give feedback.
-
@julianna-langston is the one who who implemented accessibilityLayer. Julianna, any ideas here? |
Beta Was this translation helpful? Give feedback.
-
Sorry, I don't have access to a mac to test this. I can confirm that Reproduction steps:
In the mean time, @wesngu28, can you elaborate on what you mean by "the axes seem to hijack the navigability"? Can you:
|
Beta Was this translation helpful? Give feedback.
-
Well, I've got some good news and some bad news. The good news is I can tell you how to make it work. While running VoiceOver, you need to turn QuickNav off (press the left and right arrow at the same time). If the user is running VoiceOver, turns off Quick Nav, focuses on the chart, and then press the left or right arrow keys, the tooltip will move as expected. VoiceOver will also read out the contents of the tooltip. The bad news is that the user has to know to turn QuickNav off. Technical background The only answer I can give you right now is that you'll need to provide documentation to your users to the effect of:
Please let me know if you have any other questions. I'll update this discussion if I learn anything new. |
Beta Was this translation helpful? Give feedback.
-
@julianna-langston I took the liberty of copy pasting your reply to a wiki page where hopefully it will be more discoverable: https://github.com/recharts/recharts/wiki/Recharts-and-accessibility please feel free to update with new findings! |
Beta Was this translation helpful? Give feedback.
-
Does the accessibilityLayer prop work when the layout is vertical |
Beta Was this translation helpful? Give feedback.
Well, I've got some good news and some bad news.
The good news is I can tell you how to make it work. While running VoiceOver, you need to turn QuickNav off (press the left and right arrow at the same time). If the user is running VoiceOver, turns off Quick Nav, focuses on the chart, and then press the left or right arrow keys, the tooltip will move as expected. VoiceOver will also read out the contents of the tooltip.
The bad news is that the user has to know to turn QuickNav off.
Technical background
In order to support keyboard navigation, Recharts adds a keydown event listener to the chart. If you're not running a screen reader, you can tab to the chart, and press left/right arrow key…