From 69aab8d2d364783f1d5de9c1a8b7336473631746 Mon Sep 17 00:00:00 2001 From: Brian Grohe Date: Thu, 31 Oct 2019 20:49:44 -0400 Subject: [PATCH 1/2] Added support for the shadowdom --- src/js/select2/dropdown/attachBody.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/select2/dropdown/attachBody.js b/src/js/select2/dropdown/attachBody.js index 1ef2373c..ca41a9dc 100644 --- a/src/js/select2/dropdown/attachBody.js +++ b/src/js/select2/dropdown/attachBody.js @@ -195,7 +195,7 @@ define([ left: 0 }; - if ($.contains(document.body, $offsetParent[0])) { + if ($.contains(document.body, $offsetParent[0]) || $offsetParent[0].isConnected) { parentOffset = $offsetParent.offset(); } From 69bcf1a0342565bb75a6926d6db8349163fd1aa7 Mon Sep 17 00:00:00 2001 From: Brian Grohe Date: Thu, 31 Oct 2019 21:07:18 -0400 Subject: [PATCH 2/2] Fix line length issue --- src/js/select2/dropdown/attachBody.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/js/select2/dropdown/attachBody.js b/src/js/select2/dropdown/attachBody.js index ca41a9dc..352b0c67 100644 --- a/src/js/select2/dropdown/attachBody.js +++ b/src/js/select2/dropdown/attachBody.js @@ -195,7 +195,10 @@ define([ left: 0 }; - if ($.contains(document.body, $offsetParent[0]) || $offsetParent[0].isConnected) { + if ( + $.contains(document.body, $offsetParent[0]) || + $offsetParent[0].isConnected + ) { parentOffset = $offsetParent.offset(); }