iter(g98): 弹窗与抽屉补遮罩关闭开关

This commit is contained in:
HIsheR
2026-10-26 13:16:32 +08:00
parent 13266f0816
commit c32f20cc9b
8 changed files with 53 additions and 5 deletions
+3 -1
View File
@@ -15,7 +15,9 @@ export function modal(props: ModalProps, ...children: unknown[]): HTMLElement {
const overlay = h('div', {
class: 'ua-modal-overlay',
onClick: (e: Event) => {
if (e.target === overlay) close(); // 卫语句:仅点遮罩本身关闭
if (e.target !== overlay) return; // 卫语句:只处理点在遮罩本身的
if (props.closeOnOverlay === false) return; // 显式禁止时防误关,× 与 Esc 仍可用
close();
},
});
const box = h(