This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues/pull-requests.
bytedo
/
wcui
Archived
1
0
Fork 0

clickOutside兼容辣鸡火狐

old
宇天 2019-08-29 09:32:14 +08:00
parent 00bf4f3d42
commit 4e8e2cdcb4
1 changed files with 6 additions and 3 deletions

View File

@ -98,9 +98,12 @@ export const clickOutside = function(dom, fn = noop) {
}
}
} else {
var target = ev.originalTarget || ev.target
console.log(target, typeof target, target.__proto__)
if (dom === target || dom.contains(target)) {
var target = ev.explicitOriginalTarget || ev.target
if (
dom === target ||
dom.contains(target) ||
(dom.root && dom.root.contains(target))
) {
return
}
}