mirror of
https://github.com/twentyhq/twenty.git
synced 2024-11-28 09:12:37 +03:00
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
This commit is contained in:
parent
a69711429b
commit
f3dfd06571
@ -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 />
|
||||
|
Loading…
Reference in New Issue
Block a user