From d8418cc6c66775a049ec6641d1df6acfed5293fc Mon Sep 17 00:00:00 2001 From: Andrew Harvey Date: Fri, 22 Mar 2019 11:15:37 +1100 Subject: [PATCH] reset this.lastSelected on clear (#224) --- lib/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 1948fc4b..b70afa2a 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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; } }, @@ -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;