Skip to content

Commit

Permalink
Fix error where links would still open editor eroniously
Browse files Browse the repository at this point in the history
  • Loading branch information
jassmith committed Aug 30, 2022
1 parent 4fc0af8 commit 121dfc4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/cells/src/cells/links-cell.tsx
Expand Up @@ -70,6 +70,7 @@ const renderer: CustomRenderer<LinksCell> = {
const hovered = onClickSelect(e);
if (hovered !== undefined) {
hovered.onClick?.();
e.preventDefault();
}
return undefined;
},
Expand Down
6 changes: 5 additions & 1 deletion packages/core/src/data-editor/data-editor.tsx
Expand Up @@ -1591,7 +1591,11 @@ const DataEditorImpl: React.ForwardRefRenderFunction<DataEditorRef, DataEditorPr
]);
}
}
if (mouse?.previousSelection?.current?.cell !== undefined && gridSelection.current !== undefined) {
if (
!isPrevented.current &&
mouse?.previousSelection?.current?.cell !== undefined &&
gridSelection.current !== undefined
) {
const [selectedCol, selectedRow] = gridSelection.current.cell;
const [prevCol, prevRow] = mouse.previousSelection.current.cell;
if (col === selectedCol && col === prevCol && row === selectedRow && row === prevRow) {
Expand Down

0 comments on commit 121dfc4

Please sign in to comment.