glideapps / glideapps/glide-data-grid

onCellEdited fires for readonly cols when getCellsForSelection is set to true

Open
#987 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
5.3k
Forks
428
PR merge metrics
No merged PRs in 30d

Description

Hello all, I just noticed that `onCellEdited` fires for `readonly` cols when `getCellsForSelection` is set to true. It seems the bug was introduced with version 6 since I was not able to reproduce it on version 5.

Steps to reproduce it:
- Add 2 cols - one enabled and one disabled for editing, with `readonly` prop
- Add `fillHandle`
- Add `getCellsForSelection`
- Drag the handle from the column you can edit to the column that you are not allow to edit
- Check on `onCellEdited`: it fires for the column that has readonly set to true

You can reproduce it here as well: https://codesandbox.io/p/sandbox/lingering-glitter-xzj2fz?file=%2Fsrc%2FApp.tsx%3A62%2C2

If you remove/comment `getCellsForSelection` then `onCellEdited` doesn't fire and it works as expected.

I'd expect that `onCellEdited` won't fire since the column is read only.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.