@ -13,8 +13,8 @@ import { RelationPickerHotkeyScope } from '@/object-record/relation-picker/types
|
||||
|
||||
import { useInlineCell } from '../hooks/useInlineCell';
|
||||
|
||||
import { RecordInlineCellContainer } from './RecordInlineCellContainer';
|
||||
import { useIsFieldReadOnly } from '@/object-record/record-field/hooks/useIsFieldReadOnly';
|
||||
import { RecordInlineCellContainer } from './RecordInlineCellContainer';
|
||||
|
||||
type RecordInlineCellProps = {
|
||||
readonly?: boolean;
|
||||
|
||||
@ -2,6 +2,7 @@ import { useContext } from 'react';
|
||||
|
||||
import { FieldInput } from '@/object-record/record-field/components/FieldInput';
|
||||
import { FieldContext } from '@/object-record/record-field/contexts/FieldContext';
|
||||
import { useIsFieldReadOnly } from '@/object-record/record-field/hooks/useIsFieldReadOnly';
|
||||
import { FieldInputEvent } from '@/object-record/record-field/types/FieldInputEvent';
|
||||
import { RecordTableContext } from '@/object-record/record-table/contexts/RecordTableContext';
|
||||
|
||||
@ -9,6 +10,7 @@ export const RecordTableCellFieldInput = () => {
|
||||
const { onUpsertRecord, onMoveFocus, onCloseTableCell } =
|
||||
useContext(RecordTableContext);
|
||||
const { entityId, fieldDefinition } = useContext(FieldContext);
|
||||
const isFieldReadOnly = useIsFieldReadOnly();
|
||||
|
||||
const handleEnter: FieldInputEvent = (persistField) => {
|
||||
onUpsertRecord({
|
||||
@ -87,7 +89,7 @@ export const RecordTableCellFieldInput = () => {
|
||||
onShiftTab={handleShiftTab}
|
||||
onSubmit={handleSubmit}
|
||||
onTab={handleTab}
|
||||
isReadOnly={true}
|
||||
isReadOnly={isFieldReadOnly}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user