summaryrefslogtreecommitdiff
path: root/overrides/endless_private
diff options
context:
space:
mode:
authorPhilip Chimento <philip@endlessm.com>2018-01-31 15:04:03 -0800
committerPhilip Chimento <philip@endlessm.com>2018-01-31 15:04:03 -0800
commit4a65687888188978e2d22fadf04aa9d09ff40359 (patch)
tree0d9aa921801a0d40c82e5188d712e0ff8d99da51 /overrides/endless_private
parent90342f56a3dd5afa7825f00001562843eebcb749 (diff)
SearchBox: Get correct index from selected match
When clicking on a result from the autocomplete popup, we should select the first index of the tree path. (The list is a flat list, so there is always only one index.) This prevents a warning about a missing property of [Symbol.toPrimitive], because we were indexing this._items with the indices array (which is not a primitive) instead of its first item. https://phabricator.endlessm.com/T21027
Diffstat (limited to 'overrides/endless_private')
-rw-r--r--overrides/endless_private/search_box.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/overrides/endless_private/search_box.js b/overrides/endless_private/search_box.js
index 104f7b8..d02462f 100644
--- a/overrides/endless_private/search_box.js
+++ b/overrides/endless_private/search_box.js
@@ -153,7 +153,7 @@ var SearchBox = new Lang.Class({
},
_onMatchSelected: function (widget, model, iter) {
- let index = model.get_path(iter).get_indices();
+ let index = model.get_path(iter).get_indices()[0];
this.emit('menu-item-selected', this._items[index]['id']);
return Gdk.EVENT_STOP;
},