소스 검색

fix: Fix Sizzle incorrect context in iframe, passed as context of iframe

赵思 2 년 전
부모
커밋
727b136583
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      src/utils/FindElement.js

+ 2 - 1
src/utils/FindElement.js

@@ -25,7 +25,8 @@ class FindElement {
       : data.selector;
 
     if (specialSelectorsRegex.test(selector)) {
-      const elements = Sizzle.matches(selector);
+      // Fix Sizzle incorrect context in iframe, passed as context of iframe
+      const elements = Sizzle(selector, documentCtx);
       if (!elements) return null;
 
       return data.multiple ? elements : elements[0];