You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Menu - Submenu remains visible even after closing the parent menu #43267
I followed the reproduction steps from this issue and can no longer reproduce the originally described behavior
("submenu remains visible"):
Open the dropdown → open the submenu → press Esc, both the dropdown and the submenu popup close correctly.
A related behavior still observed (would like to confirm if expected)
After opening both the dropdown and the submenu, when focus stays on the parent popup (the dropdown menu itself)
and Esc is pressed:
the parent popup closes;
but the submenu popup does not close along with it and remains visible on screen.
When focus is inside the submenu (on a submenu item) and Esc is pressed, both layers close as expected.
Could you confirm whether this behavior — "focus on parent + Esc does not close the submenu, leaving it visible" —
is expected, or whether it should also be fixed?
I followed the reproduction steps from this issue and can no longer reproduce the originally described behavior ("submenu remains visible"):
Open the dropdown → open the submenu → press Esc, both the dropdown and the submenu popup close correctly.
A related behavior still observed (would like to confirm if expected)
After opening both the dropdown and the submenu, when focus stays on the parent popup (the dropdown menu itself) and Esc is pressed:
the parent popup closes;
but the submenu popup does not close along with it and remains visible on screen.
When focus is inside the submenu (on a submenu item) and Esc is pressed, both layers close as expected.
Could you confirm whether this behavior — "focus on parent + Esc does not close the submenu, leaving it visible" — is expected, or whether it should also be fixed?
Thanks for revalidating! Can confirm the original issue no longer reproduces on the latest antd version.
I also tried to reproduce the issue you described, but couldn't figure out how to keep focus on the parent popup while the submenu is open. Either way, that behavior does seem like a bug too.
Activity
MadCcc commentedon Jun 29, 2023
Should focus submenu when opened.
heiyu4585 commentedon Jul 7, 2023
结论: Menu 自己维护的 active,这个有点难改的
tomislavdimitrov2003 commentedon Aug 1, 2023
Issues is still present. Will there be a fix for it soon?
yoyo837 commentedon Dec 5, 2023
react-component/menu#671 Does this fix?
SpaNb4 commentedon Dec 6, 2023
No, I can still reproduce the issue with
rc-menu9.12.3 installed: https://codesandbox.io/p/sandbox/antd-reproduction-template-forked-4rzmn8yoyo837 commentedon Dec 9, 2023
It looks like the issue is related to
triggerSubMenuAction="click".noxxxxxxxx commentedon Apr 29, 2024
Still exist in the latest version

codesandbox
EmilyyyLiu commentedon Aug 27, 2026
Reproduction result
I followed the reproduction steps from this issue and can no longer reproduce the originally described behavior
("submenu remains visible"):
A related behavior still observed (would like to confirm if expected)
After opening both the dropdown and the submenu, when focus stays on the parent popup (the dropdown menu itself)
and Esc is pressed:
When focus is inside the submenu (on a submenu item) and Esc is pressed, both layers close as expected.
Could you confirm whether this behavior — "focus on parent + Esc does not close the submenu, leaving it visible" —
is expected, or whether it should also be fixed?
SpaNb4 commentedon Aug 28, 2026
Thanks for revalidating! Can confirm the original issue no longer reproduces on the latest antd version.
However, I found another related issue: open the dropdown menu → open the submenu → press Tab twice (or once if focus is on the submenu). The parent popup closes but the submenu stays visible. Video attached: video
Sandbox to reproduce: https://codesandbox.io/p/devbox/antd-reproduction-template-forked-8hdkf3
I also tried to reproduce the issue you described, but couldn't figure out how to keep focus on the parent popup while the submenu is open. Either way, that behavior does seem like a bug too.