Skip to content

Commit 8a5ec2f

Browse files
committed
fix: Clear input should close panel
1 parent 4e73a33 commit 8a5ec2f

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/Picker.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ function InnerPicker<DateType>(props: PickerProps<DateType>) {
371371
onClick={e => {
372372
e.stopPropagation();
373373
triggerChange(null);
374+
triggerOpen(false, true);
374375
}}
375376
className={`${prefixCls}-clear`}
376377
>

tests/picker.spec.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ describe('Picker.Basic', () => {
233233

234234
wrapper.clearValue();
235235
expect(onChange).toHaveBeenCalledWith(null, '');
236+
expect(wrapper.isOpen()).toBeFalsy();
236237

237238
wrapper.openPicker();
238239
expect(wrapper.find(selected).length).toBeFalsy();

0 commit comments

Comments
 (0)