소스 검색

Merge pull request #5691 from paxnovem/GH-5682

Fix support for the Shadow DOM when calculating offsets
Kevin Brown 5 년 전
부모
커밋
1da125f11e
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      src/js/select2/dropdown/attachBody.js

+ 4 - 1
src/js/select2/dropdown/attachBody.js

@@ -195,7 +195,10 @@ define([
       left: 0
     };
 
-    if ($.contains(document.body, $offsetParent[0])) {
+    if (
+      $.contains(document.body, $offsetParent[0]) ||
+      $offsetParent[0].isConnected
+      ) {
       parentOffset = $offsetParent.offset();
     }