Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow non-result node to be displayed with the result nodes.

  • Loading branch information...
commit 54196f42d1057b71cb7e32c74df5553c01ce4f94 1 parent c5478d1
@hedgerwang hedgerwang authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/lib/control/typeahead/Typeahead.js
View
9 src/lib/control/typeahead/Typeahead.js
@@ -217,10 +217,14 @@ JX.install('Typeahead', {
showResults : function(results) {
var obj = {show: results};
var e = this.invoke('show', obj);
- this._display = obj.show;
+
+ // Note that the results list may have been update by the "show" event
+ // listener. Non-result node (e.g. divider or label) may have been
+ // inserted.
+ JX.DOM.setContent(this._root, results);
+ this._display = JX.DOM.scry(this._root, 'a', 'typeahead-result');
if (this._display.length && !e.getPrevented()) {
- JX.DOM.setContent(this._root, this._display);
this._changeFocus(Number.NEGATIVE_INFINITY);
var d = JX.Vector.getDim(this._hardpoint);
d.x = 0;
@@ -231,6 +235,7 @@ JX.install('Typeahead', {
JX.DOM.show(this._root);
} else {
this.hide();
+ JX.DOM.setContent(this._root, null);
}
},
Please sign in to comment.
Something went wrong with that request. Please try again.