🏁 ie does not support document.contains (#1016)

Co-authored-by: gongshun <gongshun@gridsum.com>
This commit is contained in:
gongshun 2020-10-22 14:50:30 +08:00 committed by GitHub
parent 6f12329b41
commit 917c4f0cf3

View File

@ -136,7 +136,7 @@ export function isEnableScopedCSS(sandbox: FrameworkConfiguration['sandbox']) {
*/
export function getXPathForElement(el: Node, document: Document): string | void {
// not support that if el not existed in document yet(such as it not append to document before it mounted)
if (!document.contains(el)) {
if (!document.body.contains(el)) {
return undefined;
}