feat: focus menu item automaticly when focusing menu (#35407)

* feat: focus menu item automaticly when focusing menu

* chore: update mentions

* test: fix test case

* chore: decrease bundle size

* chore: increase bundle size
This commit is contained in:
MadCcc 2022-05-07 11:36:34 +08:00 committed by GitHub
parent 63d3c579f9
commit 4734f65f2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View File

@ -942,14 +942,12 @@ describe('Menu', () => {
const ref = React.createRef();
const { container } = render(
<Menu ref={ref}>
<SubMenu key="sub1" title="Navigation One">
<Menu.Item key="1">Option 1</Menu.Item>
</SubMenu>
<Menu.Item key="1">Option 1</Menu.Item>
</Menu>,
);
expect(ref.current?.menu?.list).toBe(container.querySelector('ul'));
ref.current?.focus();
expect(document.activeElement).toBe(container.querySelector('ul'));
expect(document.activeElement).toBe(container.querySelector('li'));
});
it('expandIcon', () => {

View File

@ -133,8 +133,8 @@
"rc-image": "~5.6.0",
"rc-input": "~0.0.1-alpha.5",
"rc-input-number": "~7.3.0",
"rc-mentions": "~1.7.0",
"rc-menu": "~9.5.5",
"rc-mentions": "~1.8.0",
"rc-menu": "~9.6.0",
"rc-motion": "^2.5.1",
"rc-notification": "~4.6.0",
"rc-pagination": "~3.1.9",