From f3dfd06571412513eeea1a7227ae5d3eab1c6d90 Mon Sep 17 00:00:00 2001 From: Uwem Israel Date: Tue, 14 Nov 2023 15:07:41 +0100 Subject: [PATCH] feat: Unfocus cells when mouse leaves the table (#2442) * feat: Unfocus cells when mouse leaves the table * fix: only unfocus cells that are not in edit mode --- .../ui/object/record-table/components/RecordTableV1.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/front/src/modules/ui/object/record-table/components/RecordTableV1.tsx b/front/src/modules/ui/object/record-table/components/RecordTableV1.tsx index 09cd14dfa..f6c740245 100644 --- a/front/src/modules/ui/object/record-table/components/RecordTableV1.tsx +++ b/front/src/modules/ui/object/record-table/components/RecordTableV1.tsx @@ -90,6 +90,7 @@ export const RecordTableV1 = ({ updateEntityMutation }: RecordTableV1Props) => { setRowSelectedState, resetTableRowSelection, useMapKeyboardToSoftFocus, + getIsSomeCellInEditMode, } = useRecordTable(); useMapKeyboardToSoftFocus(); @@ -117,11 +118,17 @@ export const RecordTableV1 = ({ updateEntityMutation }: RecordTableV1Props) => { }, }); + const handleMouseLeave = () => { + const isSomeCellInEditMode = getIsSomeCellInEditMode(); + if (isSomeCellInEditMode) return; + leaveTableFocus(); + }; + return ( -
+