1
0
mirror of synced 2024-11-22 13:06:08 +03:00

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:
Ryan Cousart 2016-04-17 16:56:15 -04:00 committed by Kevin Brown
parent c099755012
commit ecdc416635

View File

@ -182,7 +182,7 @@ define([
if (newDirection == 'above' || if (newDirection == 'above' ||
(isCurrentlyAbove && newDirection !== 'below')) { (isCurrentlyAbove && newDirection !== 'below')) {
css.top = container.top - dropdown.height; css.top = container.top - parentOffset.top - dropdown.height;
} }
if (newDirection != null) { if (newDirection != null) {