From 35e4f7db4f9c42d0d9c5623cf2f7c3e07580b0cc Mon Sep 17 00:00:00 2001 From: Katherine Date: Tue, 19 Nov 2024 16:07:16 +0800 Subject: [PATCH] fix: issue when switching operators in filter button and submit date field (#5684) --- lerna.json | 4 +--- .../src/schema-component/antd/date-picker/DatePicker.tsx | 6 ++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lerna.json b/lerna.json index 61db1ea613..5a3a4632c3 100644 --- a/lerna.json +++ b/lerna.json @@ -2,9 +2,7 @@ "version": "1.4.0-alpha.17", "npmClient": "yarn", "useWorkspaces": true, - "npmClientArgs": [ - "--ignore-engines" - ], + "npmClientArgs": ["--ignore-engines"], "command": { "version": { "forcePublish": true, diff --git a/packages/core/client/src/schema-component/antd/date-picker/DatePicker.tsx b/packages/core/client/src/schema-component/antd/date-picker/DatePicker.tsx index e78ab96885..edbc6a9122 100644 --- a/packages/core/client/src/schema-component/antd/date-picker/DatePicker.tsx +++ b/packages/core/client/src/schema-component/antd/date-picker/DatePicker.tsx @@ -173,6 +173,12 @@ DatePicker.FilterWithPicker = function FilterWithPicker(props: any) { showTime: props.showTime ? { defaultValue: dayjs('00:00:00', 'HH:mm:ss') } : false, format: targetFormat, picker: targetPicker, + onChange: (val) => { + props.onChange(undefined); + setTimeout(() => { + props.onChange(val); + }); + }, }; const field: any = useField(); const [stateProps, setStateProps] = useState(newProps);