mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-29 00:16:39 +01:00
fix date fields render loop
This commit is contained in:
@@ -63,11 +63,7 @@ export default function Date_({
|
||||
},
|
||||
"& .MuiInputAdornment-root": { m: 0 },
|
||||
}}
|
||||
// Prevent react-data-grid showing NullEditor, which unmounts this field
|
||||
onDoubleClick={(e) => e.stopPropagation()}
|
||||
onKeyDown={(e) => e.stopPropagation()}
|
||||
// Touch mode: make the whole field clickable
|
||||
onClick={props.inputProps?.onClick as any}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
inputProps={{ ...props.inputProps, tabIndex }}
|
||||
/>
|
||||
)}
|
||||
@@ -86,6 +82,7 @@ export default function Date_({
|
||||
components={{ OpenPickerIcon: ChevronDown }}
|
||||
disableOpenPicker={false}
|
||||
disabled={disabled}
|
||||
PopperProps={{ onClick: (e) => e.stopPropagation() }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ export const config: IFieldConfig = {
|
||||
initializable: true,
|
||||
icon: <DateIcon />,
|
||||
description: `Formatted date. Format is configurable, default: ${DATE_FORMAT}. Edited with a visual picker.`,
|
||||
TableCell: withTableCell(DisplayCell, EditorCell, "inline", {
|
||||
TableCell: withTableCell(DisplayCell, EditorCell, "focus", {
|
||||
disablePadding: true,
|
||||
}),
|
||||
SideDrawerField,
|
||||
|
||||
@@ -68,11 +68,8 @@ export default function DateTime({
|
||||
},
|
||||
"& .MuiInputAdornment-root": { m: 0 },
|
||||
}}
|
||||
// Prevent react-data-grid showing NullEditor, which unmounts this field
|
||||
onDoubleClick={(e) => e.stopPropagation()}
|
||||
onKeyDown={(e) => e.stopPropagation()}
|
||||
// Touch mode: make the whole field clickable
|
||||
onClick={props.inputProps?.onClick as any}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
inputProps={{ ...props.inputProps, tabIndex }}
|
||||
/>
|
||||
)}
|
||||
@@ -90,6 +87,7 @@ export default function DateTime({
|
||||
components={{ OpenPickerIcon: ChevronDown }}
|
||||
disableOpenPicker={false}
|
||||
disabled={disabled}
|
||||
PopperProps={{ onClick: (e) => e.stopPropagation() }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ export const config: IFieldConfig = {
|
||||
initializable: true,
|
||||
icon: <DateTimeIcon />,
|
||||
description: `Formatted date & time. Format is configurable, default: ${DATE_TIME_FORMAT}. Edited with a visual picker.`,
|
||||
TableCell: withTableCell(DisplayCell, EditorCell, "inline", {
|
||||
TableCell: withTableCell(DisplayCell, EditorCell, "focus", {
|
||||
disablePadding: true,
|
||||
}),
|
||||
SideDrawerField,
|
||||
|
||||
Reference in New Issue
Block a user