Fix offsets not calculated correctly sometimes on select2 dropdowns closes #29163

This commit is contained in:
roykho 2021-03-16 07:39:09 -07:00
parent f1cb81d5db
commit a1cda953dc
No known key found for this signature in database
GPG Key ID: 7B36C0EA25795714
1 changed files with 1 additions and 2 deletions

View File

@ -4398,7 +4398,6 @@ S2.define('select2/dropdown/attachBody',[
var parentOffset = $offsetParent.offset();
css.top -= parentOffset.top;
css.left -= parentOffset.left;
if (!isCurrentlyAbove && !isCurrentlyBelow) {
@ -4413,7 +4412,7 @@ S2.define('select2/dropdown/attachBody',[
if (newDirection == 'above' ||
(isCurrentlyAbove && newDirection !== 'below')) {
css.top = container.top - parentOffset.top - dropdown.height;
css.top = container.top - dropdown.height;
}
if (newDirection != null) {