mirror of
https://github.com/twentyhq/twenty.git
synced 2024-11-26 13:42:44 +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 { useContext } from 'react';
|
||||||
|
|
||||||
import { FieldContext } from '@/object-record/record-field/contexts/FieldContext';
|
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 { FieldDefinition } from '@/object-record/record-field/types/FieldDefinition';
|
||||||
import { FieldMetadata } from '@/object-record/record-field/types/FieldMetadata';
|
import { FieldMetadata } from '@/object-record/record-field/types/FieldMetadata';
|
||||||
import { CellHotkeyScopeContext } from '@/object-record/record-table/contexts/CellHotkeyScopeContext';
|
import { CellHotkeyScopeContext } from '@/object-record/record-table/contexts/CellHotkeyScopeContext';
|
||||||
@ -34,6 +35,8 @@ export const useOpenRecordTableCellFromCell = () => {
|
|||||||
const { isReadOnly, pathToShowPage, objectNameSingular } = useContext(
|
const { isReadOnly, pathToShowPage, objectNameSingular } = useContext(
|
||||||
RecordTableRowContext,
|
RecordTableRowContext,
|
||||||
);
|
);
|
||||||
|
const isFieldReadOnly = useIsFieldReadOnly();
|
||||||
|
const cellIsReadOnly = isReadOnly || isFieldReadOnly;
|
||||||
|
|
||||||
const openTableCell = (
|
const openTableCell = (
|
||||||
initialValue?: string,
|
initialValue?: string,
|
||||||
@ -44,7 +47,7 @@ export const useOpenRecordTableCellFromCell = () => {
|
|||||||
customCellHotkeyScope,
|
customCellHotkeyScope,
|
||||||
recordId,
|
recordId,
|
||||||
fieldDefinition,
|
fieldDefinition,
|
||||||
isReadOnly,
|
isReadOnly: cellIsReadOnly,
|
||||||
pathToShowPage,
|
pathToShowPage,
|
||||||
objectNameSingular,
|
objectNameSingular,
|
||||||
initialValue,
|
initialValue,
|
||||||
|
Loading…
Reference in New Issue
Block a user