Sorting table with narrator on switches focus to "Search:" edit field.
Sorting table with narrator on switches focus to "Search:" edit field.
makist
Posts: 2Questions: 1Answers: 0
Looking at the example under https://datatables.net/examples/basic_init/table_sorting.html
Noticed that when Windows Narrator is on, if I press "Enter" to sort by the column criteria, the Narrator focus jumps to the "Search: " edit field.
I would like to keep the focus on the selected column header. Any tips on how to achieve this?
Answers
That really sounds like a Windows Narrator bug. The focus should stay on the header cell. I don't have a Windows machine to hand at the moment, but does this happen in all browsers? Does the focus stay on the header cell that was sorted if Narrator is off?
Allan
Hi Allan,
It happens in all browsers I tested (Edge, Chrome, and Firefox -- all most up-to-date official stable releases). The focus stays on the cell when Narrator is off.
I'm trying to code some hack around this, without success so far. One option I was trying is to capture a keydown/keyup event and then move the focus back to the column header when needed. But this fails because the Narrator handles the key event itself and does not forward it to the web page code.
Thanks for your reply,
makist
This is where DataTables added its listeners for the sort action trigger.
That in turn called this function, which as you can see will call
e.preventDefault()
when a keypress on the return key is detected. That alone should keep the focus where it is.I'm certain that this is a Narrator bug I'm afraid. One to report to Microsoft.
Allan