From 08937b57b82691bf47d674c283406b3cef8897a3 Mon Sep 17 00:00:00 2001 From: Ed Morales Date: Tue, 25 Jul 2017 15:28:12 -0700 Subject: [PATCH] fix(chips): close manually autocomplete menu on mousedown (#784) since we are stopping the propagation of the click event for chips, this causes some issues with autocomplete since its listening to it --- src/platform/core/chips/chips.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platform/core/chips/chips.component.ts b/src/platform/core/chips/chips.component.ts index 789b4fe9e0..e9a107d24a 100644 --- a/src/platform/core/chips/chips.component.ts +++ b/src/platform/core/chips/chips.component.ts @@ -714,7 +714,7 @@ export class TdChipsComponent extends _TdChipsMixinBase implements ControlValueA */ private _watchOutsideClick(): void { if (this._document) { - this._outsideClickSubs = RxChain.from(fromEvent(this._document, 'click')).call(filter, (event: MouseEvent) => { + this._outsideClickSubs = RxChain.from(fromEvent(this._document, 'mousedown')).call(filter, (event: MouseEvent) => { const clickTarget: HTMLElement = event.target; setTimeout(() => { this._internalClick = false; @@ -724,6 +724,7 @@ export class TdChipsComponent extends _TdChipsMixinBase implements ControlValueA !this._elementRef.nativeElement.contains(clickTarget) && !this._internalClick; }).subscribe(() => { if (this.focused) { + this._autocompleteTrigger.closePanel(); this.removeFocusedState(); this.onTouched(); this._changeDetectorRef.markForCheck();