Skip to content

Commit 1da125f

Browse files
authored
Merge pull request select2#5691 from paxnovem/select2GH-5682
Fix support for the Shadow DOM when calculating offsets
2 parents e809aa0 + 69bcf1a commit 1da125f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/js/select2/dropdown/attachBody.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,10 @@ define([
195195
left: 0
196196
};
197197

198-
if ($.contains(document.body, $offsetParent[0])) {
198+
if (
199+
$.contains(document.body, $offsetParent[0]) ||
200+
$offsetParent[0].isConnected
201+
) {
199202
parentOffset = $offsetParent.offset();
200203
}
201204

0 commit comments

Comments
 (0)