diff --git a/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellContainer.tsx b/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellContainer.tsx index 0ca058098..fa81021da 100644 --- a/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellContainer.tsx +++ b/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellContainer.tsx @@ -43,7 +43,6 @@ const StyledLabelAndIconContainer = styled.div` `; const StyledValueContainer = styled.div<{ readonly: boolean }>` - cursor: ${({ readonly }) => (readonly ? 'default' : 'pointer')}; display: flex; min-width: 0; position: relative; @@ -72,7 +71,7 @@ const StyledLabelContainer = styled.div<{ width?: number }>` width: ${({ width }) => width}px; `; -const StyledInlineCellBaseContainer = styled.div` +const StyledInlineCellBaseContainer = styled.div<{ readonly: boolean }>` box-sizing: border-box; width: 100%; display: flex; @@ -80,6 +79,7 @@ const StyledInlineCellBaseContainer = styled.div` gap: ${({ theme }) => theme.spacing(1)}; user-select: none; align-items: center; + cursor: ${({ readonly }) => (readonly ? 'default' : 'pointer')}; `; export const StyledSkeletonDiv = styled.div` @@ -96,22 +96,19 @@ export const RecordInlineCellContainer = () => { editModeContentOnly, } = useRecordInlineCellContext(); + const { isInlineCellInEditMode, openInlineCell } = useInlineCell(); + const { recordId, fieldDefinition } = useContext(FieldContext); + const shouldContainerBeClickable = + !readonly && !editModeContentOnly && !isInlineCellInEditMode; + if (isFieldText(fieldDefinition)) { assertFieldMetadata(FieldMetadataType.TEXT, isFieldText, fieldDefinition); } const { setIsFocused } = useFieldFocus(); - const { openInlineCell } = useInlineCell(); - - const handleDisplayModeClick = () => { - if (!readonly && !editModeContentOnly) { - openInlineCell(); - } - }; - const handleContainerMouseEnter = () => { if (!readonly) { setIsFocused(true); @@ -132,9 +129,10 @@ export const RecordInlineCellContainer = () => { return ( {(IconLabel || label) && ( diff --git a/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellValue.tsx b/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellValue.tsx index e9ff2c3d3..5d369a42e 100644 --- a/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellValue.tsx +++ b/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellValue.tsx @@ -50,19 +50,11 @@ export const RecordInlineCellValue = () => { {!readonly && isInlineCellInEditMode && ( {editModeContent} )} - {editModeContentOnly ? ( - - - {editModeContent} - - - ) : ( - - - {displayModeContent} - - - )} + + + {editModeContentOnly ? editModeContent : displayModeContent} + + ); };