Use timeout to get selected autocomplete value instead of just the entered text

This commit is contained in:
Nathan Gray 2015-04-15 22:33:06 +00:00
parent 98b76c0f49
commit 5a6d9b5fcb

View File

@ -2178,7 +2178,12 @@ var et2_nextmatch_header_bar = et2_DOMWidget.extend(et2_INextmatchHeader,
{
event.preventDefault();
self.getInstanceManager().autocomplete_fixer();
self.nextmatch.applyFilters({search: self.search.getValue()});
// Use a timeout to make sure we get the autocomplete value,
// if one was chosen, instead of what was actually typed.
// Chrome doesn't need this, but FF does.
window.setTimeout(function() {
self.nextmatch.applyFilters({search: self.search.getValue()});
},0);
}
});
// Firefox treats search differently. Add in the clear button.