KeyTable focus on row after upgrading
KeyTable focus on row after upgrading
mustafamond
Posts: 40Questions: 11Answers: 0
Hello,
I upgraded the main datatables to version 1.12 from version 1.10 and KeyTable from 2.5.2 to 2.7.0 and am experiencing a difference in behavior. To focus on the top visible row when pressing <tab> in the filter field, in 1.10/2.5.2, I used
//Tab in filter goes to first visibe datatable row
$("div.dataTables_filter input").keydown(function (e) {
if (e.which == 9) {
var scrollStart = viewTable.scroller.page().start;
viewTable.cell(":eq(" + scrollStart + ")", ":eq(0)", { search: "applied" }).focus();
}
});
This no longer works in 1.12/2.7.0 - it focuses instead on the column header. Is there a better way to focus on the top visible row in the new version?
Thank you
Answers
Hi,
That's a keyboard accessibility requirement. It can be seen happening here. Focus on the search input then press tab and it will focus in the header cell.
I'm slightly surprised your workaround doesn't work anymore. However, here is an alternative.
Allan