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