mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-29 00:16:39 +01:00
fix: context right click menu breaks when cell being selected is in editor mode
This commit is contained in:
@@ -182,13 +182,27 @@ export const TableCell = memo(function TableCell({
|
||||
}}
|
||||
onContextMenu={(e) => {
|
||||
e.preventDefault();
|
||||
setSelectedCell({
|
||||
path: row.original._rowy_ref.path,
|
||||
columnKey: cell.column.id,
|
||||
focusInside: false,
|
||||
|
||||
let isEditorCell = false;
|
||||
|
||||
setSelectedCell((prev) => {
|
||||
isEditorCell = prev?.focusInside === true;
|
||||
return {
|
||||
path: row.original._rowy_ref.path,
|
||||
columnKey: cell.column.id,
|
||||
focusInside: false,
|
||||
// focusInside: !!!prev
|
||||
// ? false
|
||||
// : prev?.columnKey === cell.column.id &&
|
||||
// prev.path === row.original._rowy_ref.path
|
||||
// ? prev?.focusInside
|
||||
// : false,
|
||||
};
|
||||
});
|
||||
(e.target as HTMLDivElement).focus();
|
||||
setContextMenuTarget(e.target as HTMLElement);
|
||||
if (!isEditorCell) {
|
||||
setContextMenuTarget(e.target as HTMLElement);
|
||||
}
|
||||
}}
|
||||
>
|
||||
{renderedValidationTooltip}
|
||||
|
||||
Reference in New Issue
Block a user