diff --git a/qui/controls/buttons/Select.css b/qui/controls/buttons/Select.css index 057a7a7616ac71e8aa46808738a4ec458155d3ea..2890c787e52f8c287adfa94e08f47c9f536a0e22 100644 --- a/qui/controls/buttons/Select.css +++ b/qui/controls/buttons/Select.css @@ -61,9 +61,11 @@ } .qui-select-search { + border: none !important; position: absolute; left: 0; top: 0; + width: 100%; } .qui-select-container .qui-contextmenu-container { diff --git a/qui/controls/buttons/Select.js b/qui/controls/buttons/Select.js index 03033e1e5ac1fc418cf178d9f7f0bca99babed88..5f823bb3c8e4c8e11fefc2b34988e209ba225517 100644 --- a/qui/controls/buttons/Select.js +++ b/qui/controls/buttons/Select.js @@ -1035,9 +1035,9 @@ define('qui/controls/buttons/Select', [ return Child.getAttribute('text').toString().toLowerCase().substr(0, 1) === value; }); - if (!found.length) { - return; - } + // if (!found.length) { + // return; + // } this.$Search = new Element('input', { 'class': 'qui-select-search', @@ -1046,9 +1046,10 @@ define('qui/controls/buttons/Select', [ keyup: function (event) { event.stop(); - var value = this.value, - Menu = self.$Menu, - children = Menu.getChildren(); + var value = this.value, + Menu = self.$Menu, + children = Menu.getChildren(), + displayedOne = false; value = value.toString().toLowerCase(); @@ -1058,16 +1059,22 @@ define('qui/controls/buttons/Select', [ if (!text.toString().toLowerCase().replace(/ /g, '').match(value)) { Child.hide(); } else { + displayedOne = true; Child.show(); } }); + if (!displayedOne) { + self.$Menu.hide(); + return; + } + var Elm = self.getElm(), MenuElm = self.$Menu.getElm(), pos = Elm.getPosition(document.body), size = Elm.getSize(); - var x = pos.x - 20, + var x = pos.x, y = pos.y + size.y; self.$Menu.setAttribute('width', size.x);