SitePen / dgrid

A lightweight, mobile-ready, data-driven, modular grid widget designed for use with dstore
http://dgrid.io/
Other
628 stars 298 forks source link

Fix keyboard navigation when the contentNode is focused #1469

Closed msssk closed 4 years ago

msssk commented 4 years ago

In a grid with few enough rows that there is empty space below them the user can click below the rows causing the grid's contentNode to receive focus. If the arrow keys are then pressed to attempt cell/row navigation an error is thrown. This change checks for and ignores selection of the contentNode.

It specifically checks for contentNode instead of the more resilient/generic "not a row or cell" because that condition is more difficult to determine. grid.row() returns undefined for grid.contentNode, but also for any node within the header. Header navigation logic depends on this.

Fixes #1297