Skip to content

Commit

Permalink
reset this.lastSelected on clear (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewharvey authored Mar 22, 2019
1 parent 4c31226 commit d8418cc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ MapboxGeocoder.prototype = {
}
this._eventEmitter.emit('result', { result: selected });
this.eventManager.select(selected, this);
this.lastSelected = selected.id;
this.lastSelected = selected.id;
}
},

Expand Down Expand Up @@ -373,6 +373,7 @@ MapboxGeocoder.prototype = {
this._onChange();
this._inputEl.focus();
this._clearEl.style.display = 'none';
this.lastSelected = null;
this._eventEmitter.emit('clear');
// reset the turnstile event
this.fresh = true;
Expand Down

0 comments on commit d8418cc

Please sign in to comment.