Fixing bug with non-static parents for dropdowns
The offset of the parent was only being subtracted if the dropdown was
facing down, this now subtracts it if the dropdown is facing up as well.
This more or less applies the same fix as
e260860789
,
but when calculating the position of the dropdown when it is facing up.
This closes https://github.com/select2/select2/issues/3303
This closes https://github.com/select2/select2/pull/4267
This commit is contained in:
parent
c099755012
commit
ecdc416635
2
src/js/select2/dropdown/attachBody.js
vendored
2
src/js/select2/dropdown/attachBody.js
vendored
@ -182,7 +182,7 @@ define([
|
||||
|
||||
if (newDirection == 'above' ||
|
||||
(isCurrentlyAbove && newDirection !== 'below')) {
|
||||
css.top = container.top - dropdown.height;
|
||||
css.top = container.top - parentOffset.top - dropdown.height;
|
||||
}
|
||||
|
||||
if (newDirection != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user