1
1
import { ReactElement , useContext , useEffect , useRef } from 'react' ;
2
- import isEmpty from 'lodash.isempty' ;
3
2
import { useRecoilValue } from 'recoil' ;
4
3
import { Key } from 'ts-key-enum' ;
5
4
import { IconArrowUpRight } from 'twenty-ui' ;
6
5
7
6
import { useClearField } from '@/object-record/record-field/hooks/useClearField' ;
8
7
import { useGetButtonIcon } from '@/object-record/record-field/hooks/useGetButtonIcon' ;
9
8
import { useIsFieldClearable } from '@/object-record/record-field/hooks/useIsFieldClearable' ;
9
+ import { useIsFieldEmpty } from '@/object-record/record-field/hooks/useIsFieldEmpty' ;
10
10
import { useIsFieldInputOnly } from '@/object-record/record-field/hooks/useIsFieldInputOnly' ;
11
11
import { useToggleEditOnlyInput } from '@/object-record/record-field/hooks/useToggleEditOnlyInput' ;
12
12
import { RecordTableCellContext } from '@/object-record/record-table/contexts/RecordTableCellContext' ;
@@ -16,6 +16,7 @@ import { useOpenRecordTableCellFromCell } from '@/object-record/record-table/rec
16
16
import { isSoftFocusUsingMouseState } from '@/object-record/record-table/states/isSoftFocusUsingMouseState' ;
17
17
import { useScopedHotkeys } from '@/ui/utilities/hotkey/hooks/useScopedHotkeys' ;
18
18
import { isNonTextWritingKey } from '@/ui/utilities/hotkey/utils/isNonTextWritingKey' ;
19
+ import { isDefined } from '~/utils/isDefined' ;
19
20
20
21
import { TableHotkeyScope } from '../../types/TableHotkeyScope' ;
21
22
@@ -40,6 +41,8 @@ export const RecordTableCellSoftFocusMode = ({
40
41
41
42
const isFieldInputOnly = useIsFieldInputOnly ( ) ;
42
43
44
+ const isEmpty = useIsFieldEmpty ( ) ;
45
+
43
46
const isFieldClearable = useIsFieldClearable ( ) ;
44
47
45
48
const toggleEditOnlyInput = useToggleEditOnlyInput ( ) ;
@@ -119,7 +122,7 @@ export const RecordTableCellSoftFocusMode = ({
119
122
const buttonIcon = isFirstColumn ? IconArrowUpRight : customButtonIcon ;
120
123
121
124
const showButton =
122
- ! ! buttonIcon &&
125
+ isDefined ( buttonIcon ) &&
123
126
! editModeContentOnly &&
124
127
( ! isFirstColumn || ! isEmpty ) &&
125
128
! isReadOnly ;
0 commit comments