1
0
mirror of synced 2024-11-22 13:06:08 +03:00
select2/tests
Kevin Brown e260860789 Correct positioning issues for statically positioned elements
There was a commit that landed in 4.0.1 that fixed positioning for
non-static elements, which are commonly used for the custom
`dropdownParent` option, but broke positioning for statically positioned
elements, commonly used in almost every other case. That commit was
c9216b4b96

This fixes the positioning issues caused by that commit by properly
calculating the offsets for statically positioned parents. Statically
positioned parents are unique, because the offset for the dropdown must
be calculated based on the closest element that is non-statically
positioned. Otherwise, the offset for any statically positioned parent
other than the body will be considerably higher than it should be,
resulting in the dropdown being offset by a large amount.

The offset parent for the body element is the html element, which is why
this works for both the body element and any custom parents for the
dropdown. This would not be needed if the parent wasn't customizable (as
seen in Select2 3.x) because you will never need to offset the body
element if it is statically positioned, because the html element almost
never has an offset.

This also fixes JSHint issues within the tests added in the last commit.

This closes https://github.com/select2/select2/issues/3970
This closes https://github.com/select2/select2/issues/3639
2016-01-01 17:15:00 -05:00
..
a11y Add tests for accessible search results 2015-11-23 18:35:36 -05:00
data Add tests for 4958961 2015-08-21 19:17:00 -04:00
dropdown Correct positioning issues for statically positioned elements 2016-01-01 17:15:00 -05:00
integration Fix select2('data') again 2015-03-14 15:23:29 -04:00
options Allow for a partial dictionary in language 2015-04-02 10:52:31 -04:00
selection Tests for the inline search box 2015-11-23 18:25:09 -05:00
utils Combine tests into common files 2015-02-13 23:29:56 -05:00
vendor Tests use jQuery 1.7.2 2015-03-11 19:20:41 -04:00
helpers.js Hook up with SauceLabs 2015-02-13 21:59:09 -05:00
integration.html Fix select2('data') again 2015-03-14 15:23:29 -04:00
unit.html Added test for attachBody 2015-12-31 13:04:38 -05:00