diff --git a/src/widgets/autocomplete/Autocomplete.js b/src/widgets/autocomplete/Autocomplete.js index f654cc6..32e7380 100644 --- a/src/widgets/autocomplete/Autocomplete.js +++ b/src/widgets/autocomplete/Autocomplete.js @@ -46,7 +46,7 @@ export class Autocomplete { this.renderContainer(); - this.setEvensts(); + this.setEvents(); } /** @@ -64,7 +64,7 @@ export class Autocomplete { /** * Autocomplete, Set Events */ - setEvensts() { + setEvents() { // Input Event Handler this.target.dxOn('input.autocomplete' + this.ekey, (e, t) => this.inputHandler(e, t)); @@ -132,11 +132,12 @@ export class Autocomplete { } } - let changed = this.value != matchId; - - this.value = matchId; + const changed = matchId && this.value != matchId; if (changed) { + + this.value = matchId; + Ut.trigger(this.opts.onChange, this); this.target.dxTrigger('changed'); } @@ -232,13 +233,13 @@ export class Autocomplete { */ restoreValue(id) { - this.value = id; - if (id == this.value) { this.clear(); return; } + this.value = id; + this.target.value = this.data[id]; Ut.trigger(this.opts.onChange, this);