Browse Source

Fix search dropdown to allow input to support bgcolors (autocomplete), fix lineheight offset on input in search selection so bged inputs do not overlap borders #1508

pull/1627/head
jlukic 9 years ago
parent
commit
4f8b80648d
3 changed files with 25 additions and 5 deletions
  1. 4
      src/definitions/modules/dropdown.js
  2. 21
      src/definitions/modules/dropdown.less
  3. 5
      src/themes/default/modules/dropdown.variables

4
src/definitions/modules/dropdown.js

@ -299,6 +299,7 @@ $.fn.dropdown = function(parameters) {
.on('click' + eventNamespace, selector.search, module.show) .on('click' + eventNamespace, selector.search, module.show)
.on('focus' + eventNamespace, selector.search, module.event.searchFocus) .on('focus' + eventNamespace, selector.search, module.event.searchFocus)
.on('blur' + eventNamespace, selector.search, module.event.searchBlur) .on('blur' + eventNamespace, selector.search, module.event.searchBlur)
.on('focus' + eventNamespace, selector.text, module.event.searchTextFocus)
; ;
} }
else { else {
@ -450,6 +451,9 @@ $.fn.dropdown = function(parameters) {
module.hide(); module.hide();
} }
}, },
searchTextFocus: function(event) {
$input.focus();
},
input: function(event) { input: function(event) {
if(module.is.searchSelection()) { if(module.is.searchSelection()) {
module.set.filtered(); module.set.filtered();

21
src/definitions/modules/dropdown.less

@ -498,20 +498,33 @@ select.ui.dropdown {
border: none !important; border: none !important;
box-shadow: none !important; box-shadow: none !important;
border-radius: 0em !important; border-radius: 0em !important;
cursor: pointer; cursor: pointer;
position: absolute;
top: 0em; top: 0em;
left: 0em; left: 0em;
width: 100%; width: 100%;
outline: none; outline: none;
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
padding: inherit; /*Amazing trick */
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
padding: inherit;
}
/* Text Layering */
.ui.search.dropdown > input.search {
position: absolute;
z-index: 2;
}
.ui.search.dropdown > .text {
position: relative;
z-index: 3;
}
.ui.search.dropdown > input:-webkit-autofill {
background: none transparent !important;
} }
/* Search Selection */ /* Search Selection */
.ui.search.selection.dropdown > input.search { .ui.search.selection.dropdown > input.search {
line-height: @searchSelectionLineHeight; line-height: @searchSelectionLineHeight;
padding: @searchSelectionInputPadding;
} }
.ui.search.dropdown.active > input.search, .ui.search.dropdown.active > input.search,

5
src/themes/default/modules/dropdown.variables

@ -176,7 +176,10 @@
@searchMinWidth: ''; @searchMinWidth: '';
/* Search Selection */ /* Search Selection */
@searchSelectionLineHeight: 1.2em;
@searchSelectionLineHeight: 1.2142em; /* browser default for webkit <input> */
@searchSelectionLineHeightOffset: ((@searchSelectionLineHeight - 1em) / 2);
@searchSelectionInputPadding: (@selectionVerticalPadding - @searchSelectionLineHeightOffset) @selectionHorizontalPadding;
@searchMobileMaxMenuHeight: @selectionMobileMaxMenuHeight; @searchMobileMaxMenuHeight: @selectionMobileMaxMenuHeight;
@searchTabletMaxMenuHeight: @selectionTabletMaxMenuHeight; @searchTabletMaxMenuHeight: @selectionTabletMaxMenuHeight;
@searchComputerMaxMenuHeight: @selectionComputerMaxMenuHeight; @searchComputerMaxMenuHeight: @selectionComputerMaxMenuHeight;

Loading…
Cancel
Save