Skip to content

Commit

Permalink
fix(pasttimepicker): fix onclear
Browse files Browse the repository at this point in the history
  • Loading branch information
YanHui committed Jul 3, 2024
1 parent ed2e137 commit 9f3e5c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/past-time-picker/PastTimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,11 @@ const PastTimePicker = (props: PastTimePickerProps) => {
className={className}
style={style}
onClick={() => setControlledVisible(!controlledVisible)}
onClear={(e) => {
e.stopPropagation();
handleOnSelect(null);
restProps?.onClear?.(e);
}}
/>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/past-time-picker/demos/PastTimePicker.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default {
},
} as Meta;

const Template: Story<PastTimePickerProps> = (args) => <PastTimePicker onSelect={action('selected value:')} placeholder="时间范围" {...args} />
const Template: Story<PastTimePickerProps> = (args) => <PastTimePicker onSelect={action('selected value:')} allowClear placeholder="时间范围" {...args} />

export const Quick = Template.bind({});
Quick.args = {
Expand Down

0 comments on commit 9f3e5c5

Please sign in to comment.