diff --git a/src/Squidex/app/framework/angular/forms/autocomplete.component.ts b/src/Squidex/app/framework/angular/forms/autocomplete.component.ts index 147199400..24115d8fa 100644 --- a/src/Squidex/app/framework/angular/forms/autocomplete.component.ts +++ b/src/Squidex/app/framework/angular/forms/autocomplete.component.ts @@ -21,6 +21,8 @@ const KEY_ESCAPE = 27; const KEY_UP = 38; const KEY_DOWN = 40; +const NO_EMIT = { emitEvent: false }; + export const SQX_AUTOCOMPLETE_CONTROL_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => AutocompleteComponent), multi: true }; @@ -118,9 +120,9 @@ export class AutocompleteComponent extends StatefulControlComponent 0) { - this.queryInput.setValue(obj[this.displayProperty]); + this.queryInput.setValue(obj[this.displayProperty], NO_EMIT); } else { - this.queryInput.setValue(obj.toString()); + this.queryInput.setValue(obj.toString(), NO_EMIT); } } @@ -130,9 +132,9 @@ export class AutocompleteComponent extends StatefulControlComponent 0) { - this.queryInput.setValue(selection[this.displayProperty], { emitEvent: false }); + this.queryInput.setValue(selection[this.displayProperty], NO_EMIT); } else { - this.queryInput.setValue(selection.toString(), { emitEvent: false }); + this.queryInput.setValue(selection.toString(), NO_EMIT); } this.callChange(selection); } finally { @@ -201,7 +203,7 @@ export class AutocompleteComponent extends StatefulControlComponent