mirror of
https://github.com/twentyhq/twenty.git
synced 2024-11-22 21:50:43 +03:00
fix: read only cells flash on click (#8057)
Fix for https://github.com/twentyhq/twenty/issues/6807
This commit is contained in:
parent
9c923ba8d5
commit
016642a940
@ -1,6 +1,7 @@
|
||||
import { useContext } from 'react';
|
||||
|
||||
import { FieldContext } from '@/object-record/record-field/contexts/FieldContext';
|
||||
import { useIsFieldReadOnly } from '@/object-record/record-field/hooks/useIsFieldReadOnly';
|
||||
import { FieldDefinition } from '@/object-record/record-field/types/FieldDefinition';
|
||||
import { FieldMetadata } from '@/object-record/record-field/types/FieldMetadata';
|
||||
import { CellHotkeyScopeContext } from '@/object-record/record-table/contexts/CellHotkeyScopeContext';
|
||||
@ -34,6 +35,8 @@ export const useOpenRecordTableCellFromCell = () => {
|
||||
const { isReadOnly, pathToShowPage, objectNameSingular } = useContext(
|
||||
RecordTableRowContext,
|
||||
);
|
||||
const isFieldReadOnly = useIsFieldReadOnly();
|
||||
const cellIsReadOnly = isReadOnly || isFieldReadOnly;
|
||||
|
||||
const openTableCell = (
|
||||
initialValue?: string,
|
||||
@ -44,7 +47,7 @@ export const useOpenRecordTableCellFromCell = () => {
|
||||
customCellHotkeyScope,
|
||||
recordId,
|
||||
fieldDefinition,
|
||||
isReadOnly,
|
||||
isReadOnly: cellIsReadOnly,
|
||||
pathToShowPage,
|
||||
objectNameSingular,
|
||||
initialValue,
|
||||
|
Loading…
Reference in New Issue
Block a user