fix(dropdown): 修复遮罩层在移动端的点击穿透问题 (#2206)

pull/2239/head
morning-star 2 months ago committed by GitHub
parent f756b41d63
commit 045ac836ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -532,7 +532,7 @@ layui.define(['jquery', 'laytpl', 'lay', 'util'], function(exports){
// 点击任意处关闭 // 点击任意处关闭
_DOC.on(clickOrMousedown, function(e){ lay(_DOC).on(clickOrMousedown, function(e){
if(!dropdown.thisId) return; if(!dropdown.thisId) return;
var that = thisModule.getThis(dropdown.thisId) var that = thisModule.getThis(dropdown.thisId)
if(!that) return; if(!that) return;
@ -550,8 +550,12 @@ layui.define(['jquery', 'laytpl', 'lay', 'util'], function(exports){
) return; ) return;
} }
if(e.type === 'touchstart' && options.elem.data(MOD_INDEX +'_opened')){
$(e.target).hasClass(STR_ELEM_SHADE) && e.preventDefault();
}
that.remove(); that.remove();
}); }, {passive: false});
// 基础菜单的静态元素事件 // 基础菜单的静态元素事件
var ELEM_LI = '.layui-menu:not(.layui-dropdown-menu) li'; var ELEM_LI = '.layui-menu:not(.layui-dropdown-menu) li';

Loading…
Cancel
Save