mirror of
https://github.com/docmost/docmost.git
synced 2026-08-29 10:05:03 +08:00
fix multi-select
This commit is contained in:
@@ -94,21 +94,21 @@ export const GridCell = memo(function GridCell({
|
|||||||
|
|
||||||
const handleMouseDown = useCallback(
|
const handleMouseDown = useCallback(
|
||||||
(e: React.MouseEvent<HTMLDivElement>) => {
|
(e: React.MouseEvent<HTMLDivElement>) => {
|
||||||
if (!property || e.button !== 0) return;
|
if (!property || e.button !== 0 || isEditing) return;
|
||||||
setFocusedCell({ rowId, propertyId: property.id });
|
setFocusedCell({ rowId, propertyId: property.id });
|
||||||
},
|
},
|
||||||
[property, rowId, setFocusedCell],
|
[property, rowId, setFocusedCell, isEditing],
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleClick = useCallback(
|
const handleClick = useCallback(
|
||||||
(e: React.MouseEvent<HTMLDivElement>) => {
|
(e: React.MouseEvent<HTMLDivElement>) => {
|
||||||
if (!property) return;
|
if (!property || isEditing) return;
|
||||||
setFocusedCell({ rowId, propertyId: property.id });
|
setFocusedCell({ rowId, propertyId: property.id });
|
||||||
(e.currentTarget.closest('[role="grid"]') as HTMLElement | null)?.focus({
|
(e.currentTarget.closest('[role="grid"]') as HTMLElement | null)?.focus({
|
||||||
preventScroll: true,
|
preventScroll: true,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[property, rowId, setFocusedCell],
|
[property, rowId, setFocusedCell, isEditing],
|
||||||
);
|
);
|
||||||
|
|
||||||
const cellReadOnly = property
|
const cellReadOnly = property
|
||||||
|
|||||||
Reference in New Issue
Block a user