iter(g28): 浮层 Esc 逐层关闭,阻止冒泡连带关外层
This commit is contained in:
@@ -73,6 +73,7 @@ export function menu(props: MenuProps): HTMLElement {
|
||||
|
||||
root.addEventListener('keydown', (e: KeyboardEvent) => {
|
||||
if (e.key === 'Escape') {
|
||||
e.stopPropagation(); // 只关本层:不再冒泡去关外层的弹窗/抽屉
|
||||
open(false);
|
||||
trigger.focus(); // 收起后焦点回到触发器,键盘流不断
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user