20260826224445
This commit is contained in:
1 parent
d750e04eee
commit
60cacfa8fb
9 files changed
+3650
-2124
No files matched your search
@@ -108,9 +108,15 @@ function toggleFullscreen() {
|
||||
}
|
||||
|
||||
// 遮罩点击关闭:wrap 铺满视口且层级高于 mask,事件实际落在 wrap 上;
|
||||
// 只响应点击 wrap 自身(面板外空白/遮罩区域),点击面板内部不关闭
|
||||
// 只响应点击 wrap 自身(面板外空白/遮罩区域),点击面板内部不关闭。
|
||||
// 记录 mousedown 是否发生在面板内:若在面板内按下(如拖选输入框文本)后
|
||||
// 拖出到遮罩再松开,click.target 会回溯为共同祖先 wrap,此时不应误判为点击遮罩。
|
||||
let maskDownInPanel = false
|
||||
function onWrapMouseDown(event) {
|
||||
maskDownInPanel = !!panelRef.value?.contains(event.target)
|
||||
}
|
||||
function onWrapClick(event) {
|
||||
if (event.target === event.currentTarget && props.maskClosable) {
|
||||
if (event.target === event.currentTarget && props.maskClosable && !maskDownInPanel) {
|
||||
requestClose()
|
||||
}
|
||||
}
|
||||
@@ -208,6 +214,7 @@ onBeforeUnmount(() => {
|
||||
v-if="isOpen"
|
||||
class="fms-modal-wrap"
|
||||
:class="{ 'fms-modal-centered': centered }"
|
||||
@mousedown="onWrapMouseDown"
|
||||
@click="onWrapClick"
|
||||
>
|
||||
<div
|
||||
|
||||
Reference in new issue
Block a user