diff --git a/src/Input.tsx b/src/Input.tsx index c2a7e23..c152f0d 100644 --- a/src/Input.tsx +++ b/src/Input.tsx @@ -214,6 +214,7 @@ const Input = forwardRef((props, ref) => { 'htmlSize', 'styles', 'classNames', + 'onClear', ], ); return ( diff --git a/tests/index.test.tsx b/tests/index.test.tsx index 59a5a26..ea76fbe 100644 --- a/tests/index.test.tsx +++ b/tests/index.test.tsx @@ -415,6 +415,7 @@ describe('Input ref', () => { it('support onClear', () => { const onClear = jest.fn(); + const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); const { container } = render( , ); @@ -422,6 +423,8 @@ describe('Input ref', () => { container.querySelector('.rc-input-clear-icon')!, ); expect(onClear).toHaveBeenCalled(); + expect(errorSpy).not.toHaveBeenCalled(); + errorSpy.mockRestore(); }); });