glide-data-grid
glide-data-grid copied to clipboard
Switch to next row when using tab to go through cells
If a user uses tab
hotkey to go through all cells, I expect that it goes to the next row if it reaches the end of the first row. However, it does switch to the next selectable element on the page instead:
https://user-images.githubusercontent.com/2852129/222752434-6b023204-dd49-4be1-8bfa-3408b1aa2360.mov
Wonder if onKeyDown
can be used as a work-around for now. On second thought, this might be undefined behavior: since in my app, we prefer if tab creates a new column (like how enter can create a new row with trailingRow).
I think what we need to do is add a callback for this event so that the user can decide what to do. In our app we actually want it to tab into the rightElement.
For this I used the onFinishedEditingCallback. In it you get the movement and with the columns you can check if there is a cell on the right. If not, just set the gridselection to the next row.