Skip to content

The open alternative to Salesforce, designed for AI.

feat: Unfocus cells when mouse leaves the table (#2442)

Uwem Israelf3dfd0657141
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 09cd14dfa42..f6c740245c8 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 (
<EntityUpdateMutationContext.Provider value={updateEntityMutation}>
<StyledTableWithHeader>
<StyledTableContainer>
- <div ref={tableBodyRef}>
+ <div ref={tableBodyRef} onMouseLeave={handleMouseLeave}>
<StyledTable className="entity-table-cell">
<RecordTableHeader />
<RecordTableBodyV1 />