Join GitHub today
Skip keyboard navigation for series that are not visibile #6838
I thought this was a feature request but it might be a bug.
If I have 3 lines and one is hidden, i don't expect keyboard navigation to navigate the hidden series.
Keyboard navigation walks the visible and hidden series
Live demo with steps to reproduce
See https://forum.highcharts.com/post135758.html for background.
I made updates to H.Chart.prototype.highlightAdjacentPoint that mostly worked here
But after looking at the code I think this line might be wrong.
I think this code should actually skip if null and skip null is set OR skipKeyboardNavigation is set as below.
I guess the question is. Should HighCharts skip hidden series or should HighCharts skip series where skipKeyboardNavigation is true?
Neither works at the moment but I would like to know if this is a feature that is planned or that is broken.
All. Not browser specific.
@primerano Thanks for reporting! The two code lines you mention are functionally identical due to operator precedence in JS, so the
We should obviously also skip hidden series, so I'll quickly add in a check for that.
added a commit
Jun 15, 2017
I guess the operator precedence works. my bad.
I do notice that the 1st point in the hidden series is available to the keyboard navigation when using skipKeyboardNavigation.
click "Hide Series". shift tab to the chart, space to enter chart and then start tabbing. 1st point selected is in the hidden series.
Also, at the end it tabs through the hidden "Series 1" legend item.
I see you already made a commit to allow skipping of hidden series. How can I test that code out?
@primerano There were definitely some bugs in the existing code, so it's great that you reported. With current code it works as it should, I believe: http://jsfiddle.net/x0d7325h/2/. You can load the latest accessibility module from
Tabbing through hidden legend items is on purpose, as it allows keyboard-only users to hide/show series using the legend.
Is there a way to disable legend navigation? In our case we have a line with all 50 states. by default we show 1 and let folks hide or show the series via a select2 control as having 50 items in the legend is a bit much,
At the moment we stop the legend clicks via
but this doesn't affect keyboard navigation.
Maybe this is a better option?
This didn't seem to do anything for me. maybe it is the wrong option?
I'll try out your fix for the series navigation next week and let you know if i find issues.
Thanks for the quick feedback and feature add. I'm not sure if the changes are in the hc5-fixes anymore because your example is navigating the series now
And I made one that uses the new legend.keyboardNavigation setting and it doesn't work either
How often do you release patch releases? Woudl 5.0.13 be out this month?
@primerano The changes are still there, but there seems to be an issue with the
Regardless, the changes are also now in master so you can use
We do release patch versions roughly every month or so, and do expect
added a commit
Sep 22, 2017
@primerano Yes, tab navigation is now used to navigate between the major chart sections (points, exporting menu, legend, etc). To move between points/series, use arrow keys (up/down/left/right). Our testing so far indicates that this is fairly intuitive to users, and has the added benefit of making chart navigation through charts with lots of points much easier. A major issue with the previous navigation model was that users were unable to tab past charts with lots of points without going through all the points of the chart.