From 9f3e5c5f6d9017e8900074d825b2008712bc1558 Mon Sep 17 00:00:00 2001 From: YanHui Date: Wed, 3 Jul 2024 18:50:09 +0800 Subject: [PATCH] fix(pasttimepicker): fix onclear --- src/past-time-picker/PastTimePicker.tsx | 5 +++++ src/past-time-picker/demos/PastTimePicker.stories.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/past-time-picker/PastTimePicker.tsx b/src/past-time-picker/PastTimePicker.tsx index c517e56bb9..1e3dbe1d8b 100644 --- a/src/past-time-picker/PastTimePicker.tsx +++ b/src/past-time-picker/PastTimePicker.tsx @@ -212,6 +212,11 @@ const PastTimePicker = (props: PastTimePickerProps) => { className={className} style={style} onClick={() => setControlledVisible(!controlledVisible)} + onClear={(e) => { + e.stopPropagation(); + handleOnSelect(null); + restProps?.onClear?.(e); + }} /> ); } diff --git a/src/past-time-picker/demos/PastTimePicker.stories.tsx b/src/past-time-picker/demos/PastTimePicker.stories.tsx index c4696988f7..03eddcae40 100644 --- a/src/past-time-picker/demos/PastTimePicker.stories.tsx +++ b/src/past-time-picker/demos/PastTimePicker.stories.tsx @@ -20,7 +20,7 @@ export default { }, } as Meta; -const Template: Story = (args) => +const Template: Story = (args) => export const Quick = Template.bind({}); Quick.args = {