glideapps / glide-data-grid

🚀 Glide Data Grid is a no compromise, outrageously react fast data grid with rich rendering, first class accessibility, and full TypeScript support.
https://grid.glideapps.com
MIT License
4.07k stars 301 forks source link

`onKeyDown` gives colum index 1 instead of 0 #938

Open 50kudos opened 7 months ago

50kudos commented 7 months ago

Issue:

When clicking a row 1 column 1 cell (data cell, not header nor. rowmaker column), the index of column is not updating to 0. So when press a keydown, it gives back column index = 1.

onKeyDown={e => {
  const [coldix, rowidx] = e.location
  // coldix == 1
}}

I suspect it is handleMaybeClick on /node_modules/@glideapps/glide-data-grid/src/data-editor/data-editor.tsx, in the if (isValidClick) block it should setGridSelection to expectedExternalGridSelection.

Can you confirm this is a bug, or it is expected? Thank you for your great library.