Explorar o código

Merge pull request #5691 from paxnovem/GH-5682

Fix support for the Shadow DOM when calculating offsets
Kevin Brown %!s(int64=5) %!d(string=hai) anos
pai
achega
1da125f11e
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  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();
     }