diff --git a/components/input/__tests__/__snapshots__/demo.test.js.snap b/components/input/__tests__/__snapshots__/demo.test.js.snap
index 17d50f273f40..ebcdd29a5b7e 100644
--- a/components/input/__tests__/__snapshots__/demo.test.js.snap
+++ b/components/input/__tests__/__snapshots__/demo.test.js.snap
@@ -2460,46 +2460,6 @@ exports[`renders ./components/input/demo/password-input.md correctly 1`] = `
-
diff --git a/components/input/__tests__/textarea.test.js b/components/input/__tests__/textarea.test.js
index 83161e2235cc..27a882c42881 100644
--- a/components/input/__tests__/textarea.test.js
+++ b/components/input/__tests__/textarea.test.js
@@ -1,3 +1,4 @@
+import { spyElementPrototypes } from 'rc-util/lib/test/domHook';
import React, { useState } from 'react';
import Input from '..';
import focusTest from '../../../tests/shared/focusTest';
@@ -530,4 +531,28 @@ describe('TextArea allowClear', () => {
rerender();
expect(container.querySelector('textarea').value).toBe('false');
});
+
+ it('should focus when clearBtn is clicked in controlled case', () => {
+ const handleFocus = jest.fn();
+
+ const textareaSpy = spyElementPrototypes(HTMLTextAreaElement, {
+ focus: handleFocus,
+ });
+
+ const Demo = () => {
+ const [value, setValue] = React.useState('');
+
+ return setValue(e.target.value)} />;
+ };
+
+ const { container } = render();
+ fireEvent.change(container.querySelector('textarea'), { target: { value: 'test' } });
+ expect(container.querySelector('.ant-input-clear-icon')?.className).not.toContain(
+ 'ant-input-clear-icon-hidden',
+ );
+ fireEvent.click(container.querySelector('.ant-input-clear-icon'));
+ expect(handleFocus).toHaveBeenCalledTimes(1);
+
+ textareaSpy.mockRestore();
+ });
});
diff --git a/components/input/demo/password-input.md b/components/input/demo/password-input.md
index f050252c214b..94e9df7884d7 100644
--- a/components/input/demo/password-input.md
+++ b/components/input/demo/password-input.md
@@ -24,10 +24,6 @@ const App: React.FC = () => (
placeholder="input password"
iconRender={visible => (visible ? : )}
/>
- (visible ? : )}
- />
);
diff --git a/components/menu/__tests__/type.test.tsx b/components/menu/__tests__/type.test.tsx
index 0d5b0b494fbb..cf3ce5916d10 100644
--- a/components/menu/__tests__/type.test.tsx
+++ b/components/menu/__tests__/type.test.tsx
@@ -1,4 +1,4 @@
-import React from 'react';
+import * as React from 'react';
import Menu from '..';
describe('Menu.typescript', () => {
diff --git a/components/menu/demo/deprecated.md b/components/menu/demo/deprecated.md
index 2b41549d8ca0..fb111a86e043 100755
--- a/components/menu/demo/deprecated.md
+++ b/components/menu/demo/deprecated.md
@@ -15,8 +15,8 @@ version: < 4.20.0
Use the syntax sugar to organize the menu directory tree. We recommend to use `items` after `4.20.0`. In the next major version, the syntax sugar will be removed to make performance improvement be possible.
```tsx
+import { AppstoreOutlined, MailOutlined, SettingOutlined } from 'infra-design-icons';
import { Menu } from 'infrad';
-import { MailOutlined, AppstoreOutlined, SettingOutlined } from 'infra-design-icons';
const App = () => (