Make bool fields editable again (#6551)

As title
This commit is contained in:
Thomas Trompette
2024-08-06 13:50:55 +02:00
committed by GitHub
parent cd33471159
commit 67c41251fb
2 changed files with 4 additions and 2 deletions

View File

@ -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;

View File

@ -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}
/>
);
};