Skip to content

Commit

Permalink
fix(module:mention): unable to select on mobile device (NG-ZORRO#4309)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsuanxyz authored and Ricbet committed Apr 9, 2020
1 parent 6e5b297 commit ee8cea3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/mention/nz-mention.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,11 @@ export class NzMentionComponent implements OnDestroy, OnInit, OnChanges {
fromEvent<TouchEvent>(this.ngDocument, 'touchend')
).subscribe((event: MouseEvent | TouchEvent) => {
const clickTarget = event.target as HTMLElement;
if (clickTarget !== this.trigger.el.nativeElement && this.isOpen) {
if (
this.isOpen &&
clickTarget !== this.trigger.el.nativeElement &&
(!!this.overlayRef && !this.overlayRef.overlayElement.contains(clickTarget))
) {
this.closeDropdown();
}
});
Expand Down

0 comments on commit ee8cea3

Please sign in to comment.