Browse Source

Complete integration of autocomplete on ui search dropdown #1508

pull/1627/head
jlukic 9 years ago
parent
commit
218083b5a3
2 changed files with 9 additions and 6 deletions
  1. 5
      src/definitions/modules/dropdown.js
  2. 10
      src/definitions/modules/dropdown.less

5
src/definitions/modules/dropdown.js

@ -299,7 +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)
.on('click' + eventNamespace, selector.text, module.event.searchTextFocus)
; ;
} }
else { else {
@ -452,7 +452,8 @@ $.fn.dropdown = function(parameters) {
} }
}, },
searchTextFocus: function(event) { searchTextFocus: function(event) {
$input.focus();
activated = true;
$search.focus();
}, },
input: function(event) { input: function(event) {
if(module.is.searchSelection()) { if(module.is.searchSelection()) {

10
src/definitions/modules/dropdown.less

@ -513,24 +513,26 @@ select.ui.dropdown {
z-index: 2; z-index: 2;
} }
.ui.search.dropdown > .text { .ui.search.dropdown > .text {
cursor: text;
position: relative; position: relative;
z-index: 3; 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; padding: @searchSelectionInputPadding;
} }
/* Active/Visible Search */
.ui.search.dropdown.active > input.search, .ui.search.dropdown.active > input.search,
.ui.search.dropdown.visible > input.search { .ui.search.dropdown.visible > input.search {
cursor: auto; cursor: auto;
} }
.ui.search.dropdown.active > .text,
.ui.search.dropdown.visible > .text {
pointer-events: none;
}
.ui.active.search.dropdown > input.search:focus + .text { .ui.active.search.dropdown > input.search:focus + .text {
color: @unselectedTextColor !important; color: @unselectedTextColor !important;
} }

Loading…
Cancel
Save