glideapps / glideapps/glide-data-grid

How to Cancel Rows Selection ?

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

Description

Image

**remark: I want to be able to unselect a row when I hold down the CTRL key and left click on a selected row. How can this be achieved? Here is my code implementation for line selection.**

const handleGridSelectionChange = (newSel) => {
let newRows = CompactSelection.empty();
if (newSel.current !== undefined) {
newRows = newRows.add([newSel.current.range.y, newSel.current.range.y + newSel.current.range.height]);
}
for (const b of newSel.current?.rangeStack ?? []) {
newRows = newRows.add([b.y, b.y + b.height]);
}
setSelection({
...newSel,
rows: newRows
});
};

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.