소스 검색

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.
Andrius Stonys 10 년 전
부모
커밋
9a689a51a0
1개의 변경된 파일1개의 추가작업 그리고 10개의 파일을 삭제
  1. 1 10
      select2.css

+ 1 - 10
select2.css

@@ -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));