1
0
mirror of synced 2025-02-09 16:49:24 +03:00

Consistent padding for .select2-search

Case: the dropdown should be shouwn above input. PositionDropdown function then operates by showing dropdown below (and  ".select2-search input" has no margin, it gets the wrong dropdown size). Then in the same function calculates the top value, but doesnt take into account, that input will have the "margin-top: 4px". Thus dropdown is displayed 4px lower.

Then the window resizes, the dropdown position is already correct, but then calculations (outerHeight()) get the height including the ".select2-search input" margin of 4px and thus moves the dropdown up.
This commit is contained in:
Andrius Stonys 2014-10-30 16:26:13 +02:00
parent a35188cb00
commit 9a689a51a0

View File

@ -180,10 +180,6 @@ html[dir="rtl"] .select2-container .select2-choice > .select2-chosen {
width: auto;
}
.select2-drop-auto-width .select2-search {
padding-top: 4px;
}
.select2-container .select2-choice .select2-arrow {
display: inline-block;
width: 18px;
@ -230,8 +226,7 @@ html[dir="rtl"] .select2-container .select2-choice .select2-arrow b {
width: 100%;
min-height: 26px;
margin: 0;
padding-left: 4px;
padding-right: 4px;
padding: 4px 4px 0 4px;
position: relative;
z-index: 10000;
@ -273,10 +268,6 @@ html[dir="rtl"] .select2-search input {
background: url('select2.png') no-repeat -37px -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
}
.select2-drop.select2-drop-above .select2-search {
padding-top: 4px;
}
.select2-search input.select2-active {
background: #fff url('select2-spinner.gif') no-repeat 100%;
background: url('select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));