diff --git a/src/list-picker/listPicker.tsx b/src/list-picker/listPicker.tsx index 1a6ea44490..be84750008 100644 --- a/src/list-picker/listPicker.tsx +++ b/src/list-picker/listPicker.tsx @@ -137,6 +137,7 @@ export const ListPicker: React.FC = (props) => { const clearInput = () => { setValue(undefined); + setPrevValue(undefined); onClear?.(); onChange?.(); }; diff --git a/src/static-date-picker/__tests__/index.test.tsx b/src/static-date-picker/__tests__/index.test.tsx index 99f1b06de7..460f1cee8c 100644 --- a/src/static-date-picker/__tests__/index.test.tsx +++ b/src/static-date-picker/__tests__/index.test.tsx @@ -5,12 +5,12 @@ import StaticDatePicker from '../StaticDatePicker'; describe('Testing StaticDatePicker ', () => { it('without params', () => { render(); - expect(screen.getByText('26')).toBeTruthy(); + expect(screen.getByText('24')).toBeTruthy(); }); it('disabledDate is function', () => { render( current.getTime() > new Date().getTime()} />); - expect(screen.getByText('26')).toBeTruthy(); + expect(screen.getByText('24')).toBeTruthy(); }); it('onPanelChange has onPanelChange', () => { @@ -24,15 +24,15 @@ describe('Testing StaticDatePicker ', () => { fireEvent.click(container.querySelector('button[class="gio-picker-header-super-prev-btn"]')); - expect(screen.getByText('26')).toBeTruthy(); + expect(screen.getByText('24')).toBeTruthy(); fireEvent.click(container.querySelector('button[class="gio-picker-header-prev-btn"]')); - expect(screen.getByText('26')).toBeTruthy(); + expect(screen.getByText('24')).toBeTruthy(); - fireEvent.click(screen.getByText('26')); + fireEvent.click(screen.getByText('24')); - expect(screen.getByText('26')).toBeTruthy(); + expect(screen.getByText('24')).toBeTruthy(); }); it('onPanelChange not onPanelChange', () => { @@ -42,6 +42,6 @@ describe('Testing StaticDatePicker ', () => { fireEvent.click(container.querySelector('button[class="gio-picker-header-super-prev-btn"]')); - expect(screen.getByText('26')).toBeTruthy(); + expect(screen.getByText('24')).toBeTruthy(); }); });