Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit 54196f42d1057b71cb7e32c74df5553c01ce4f94 1 parent c5478d1
Hedger Wang authored

Showing 1 changed file with 7 additions and 2 deletions. Show diff stats Hide diff stats

  1. +7 2 src/lib/control/typeahead/Typeahead.js
9 src/lib/control/typeahead/Typeahead.js
@@ -217,10 +217,14 @@ JX.install('Typeahead', {
217 217 showResults : function(results) {
218 218 var obj = {show: results};
219 219 var e = this.invoke('show', obj);
220   - this._display = obj.show;
  220 +
  221 + // Note that the results list may have been update by the "show" event
  222 + // listener. Non-result node (e.g. divider or label) may have been
  223 + // inserted.
  224 + JX.DOM.setContent(this._root, results);
  225 + this._display = JX.DOM.scry(this._root, 'a', 'typeahead-result');
221 226
222 227 if (this._display.length && !e.getPrevented()) {
223   - JX.DOM.setContent(this._root, this._display);
224 228 this._changeFocus(Number.NEGATIVE_INFINITY);
225 229 var d = JX.Vector.getDim(this._hardpoint);
226 230 d.x = 0;
@@ -231,6 +235,7 @@ JX.install('Typeahead', {
231 235 JX.DOM.show(this._root);
232 236 } else {
233 237 this.hide();
  238 + JX.DOM.setContent(this._root, null);
234 239 }
235 240 },
236 241

0 comments on commit 54196f4

Please sign in to comment.
Something went wrong with that request. Please try again.