Autocomplete: do not select a result without value

This commit is contained in:
Yohan Boniface 2014-06-19 11:29:42 +02:00
parent 9257264b8d
commit 28382f5aa9

View file

@ -345,7 +345,7 @@ L.S.AutoComplete.Select = L.S.AutoComplete.BaseSelect.extend({
initSelectedContainer: function () {
this.selected_container = L.DomUtil.after(this.input, L.DomUtil.element('div', {className: 'umap-singleresult'}));
var self = this;
if (this.el.selectedIndex !== -1) {
if (this.el.selectedIndex !== -1 && this.el[this.el.selectedIndex].value !== '') {
self.displaySelected(self.optionToResult(this.el[this.el.selectedIndex]));
}
},