From fc35cfc0f5df3b84ced85181333ec822d0a3bee9 Mon Sep 17 00:00:00 2001 From: YanHui Date: Thu, 21 Dec 2023 17:32:57 +0800 Subject: [PATCH 1/2] fix(pastTimePicker): fixempty quickmode confirm&cancel --- src/static-past-time-picker/QuickPicker.tsx | 6 ++++-- src/static-past-time-picker/interfaces.ts | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/static-past-time-picker/QuickPicker.tsx b/src/static-past-time-picker/QuickPicker.tsx index 9fd551b487..daf85aaaac 100644 --- a/src/static-past-time-picker/QuickPicker.tsx +++ b/src/static-past-time-picker/QuickPicker.tsx @@ -11,6 +11,7 @@ function QuickPicker({ options: optionsParams, optionsFilter, onSelect, + onCancel, timeRange, experimental, NotAvailableToday, @@ -53,7 +54,8 @@ function QuickPicker({ }; const handleCancel = () => { - onSelect(timeRange as string); + // onSelect(timeRange as string); + onCancel(); }; useEffect(() => { @@ -93,7 +95,7 @@ function QuickPicker({ - diff --git a/src/static-past-time-picker/interfaces.ts b/src/static-past-time-picker/interfaces.ts index 4f06586d02..ce9a1e1d12 100644 --- a/src/static-past-time-picker/interfaces.ts +++ b/src/static-past-time-picker/interfaces.ts @@ -81,6 +81,7 @@ export interface QuickPickerProps extends PickerProps { */ optionsFilter?: (o: Option) => boolean; NotAvailableToday?: boolean; + onCancel?: () => void; } export interface InnerRangePanelProps { From b65d849d1604fb8fcc55cbe52bf2c42a650cd9b5 Mon Sep 17 00:00:00 2001 From: YanHui Date: Thu, 21 Dec 2023 17:43:35 +0800 Subject: [PATCH 2/2] fix --- src/static-past-time-picker/QuickPicker.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/static-past-time-picker/QuickPicker.tsx b/src/static-past-time-picker/QuickPicker.tsx index daf85aaaac..9143fb0b26 100644 --- a/src/static-past-time-picker/QuickPicker.tsx +++ b/src/static-past-time-picker/QuickPicker.tsx @@ -55,7 +55,7 @@ function QuickPicker({ const handleCancel = () => { // onSelect(timeRange as string); - onCancel(); + onCancel?.(); }; useEffect(() => {