diff --git a/packages/twenty-front/src/modules/object-record/record-title-cell/components/RecordTitleCell.tsx b/packages/twenty-front/src/modules/object-record/record-title-cell/components/RecordTitleCell.tsx index af7cb13ba..67e93157d 100644 --- a/packages/twenty-front/src/modules/object-record/record-title-cell/components/RecordTitleCell.tsx +++ b/packages/twenty-front/src/modules/object-record/record-title-cell/components/RecordTitleCell.tsx @@ -16,7 +16,7 @@ import { } from '@/object-record/record-title-cell/components/RecordTitleCellContext'; import { RecordTitleCellFieldDisplay } from '@/object-record/record-title-cell/components/RecordTitleCellFieldDisplay'; import { RecordTitleCellFieldInput } from '@/object-record/record-title-cell/components/RecordTitleCellFieldInput'; -import { getRecordFieldInputId } from '@/object-record/utils/getRecordFieldInputId'; +import { getRecordTitleCellId } from '@/object-record/record-title-cell/utils/getRecordTitleCellId'; type RecordTitleCellProps = { loading?: boolean; @@ -32,11 +32,7 @@ export const RecordTitleCell = ({ const isFieldInputOnly = useIsFieldInputOnly(); const { closeInlineCell } = useInlineCell( - getRecordFieldInputId( - recordId, - fieldDefinition?.metadata?.fieldName, - 'title', - ), + getRecordTitleCellId(recordId, fieldDefinition?.fieldMetadataId), ); const handleEnter: FieldInputEvent = (persistField) => { @@ -87,10 +83,9 @@ export const RecordTitleCell = ({ return ( diff --git a/packages/twenty-front/src/modules/object-record/record-title-cell/hooks/useRecordTitleCell.tsx b/packages/twenty-front/src/modules/object-record/record-title-cell/hooks/useRecordTitleCell.tsx index 900c5dc75..a3e4c1d8c 100644 --- a/packages/twenty-front/src/modules/object-record/record-title-cell/hooks/useRecordTitleCell.tsx +++ b/packages/twenty-front/src/modules/object-record/record-title-cell/hooks/useRecordTitleCell.tsx @@ -1,5 +1,6 @@ import { isInlineCellInEditModeScopedState } from '@/object-record/record-inline-cell/states/isInlineCellInEditModeScopedState'; import { InlineCellHotkeyScope } from '@/object-record/record-inline-cell/types/InlineCellHotkeyScope'; +import { getRecordTitleCellId } from '@/object-record/record-title-cell/utils/getRecordTitleCellId'; import { useGoBackToPreviousDropdownFocusId } from '@/ui/layout/dropdown/hooks/useGoBackToPreviousDropdownFocusId'; import { usePreviousHotkeyScope } from '@/ui/utilities/hotkey/hooks/usePreviousHotkeyScope'; import { HotkeyScope } from '@/ui/utilities/hotkey/types/HotkeyScope'; @@ -25,7 +26,9 @@ export const useRecordTitleCell = () => { fieldMetadataId: string; }) => { set( - isInlineCellInEditModeScopedState(recordId + fieldMetadataId), + isInlineCellInEditModeScopedState( + getRecordTitleCellId(recordId, fieldMetadataId), + ), false, ); @@ -48,7 +51,9 @@ export const useRecordTitleCell = () => { customEditHotkeyScopeForField?: HotkeyScope; }) => { set( - isInlineCellInEditModeScopedState(recordId + fieldMetadataId), + isInlineCellInEditModeScopedState( + getRecordTitleCellId(recordId, fieldMetadataId), + ), true, ); diff --git a/packages/twenty-front/src/modules/object-record/record-title-cell/utils/getRecordTitleCellId.ts b/packages/twenty-front/src/modules/object-record/record-title-cell/utils/getRecordTitleCellId.ts new file mode 100644 index 000000000..9a710a986 --- /dev/null +++ b/packages/twenty-front/src/modules/object-record/record-title-cell/utils/getRecordTitleCellId.ts @@ -0,0 +1,6 @@ +export const getRecordTitleCellId = ( + recordId: string, + fieldMetadataId: string, +) => { + return `${recordId}-${fieldMetadataId}`; +};