Skip to content

Commit

Permalink
fix(module:mention): unable to select on mobile device (#4309)
Browse files Browse the repository at this point in the history
close #4281
  • Loading branch information
hsuanxyz authored Nov 8, 2019
1 parent 761e8e0 commit 1be6d51
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 1be6d51

Please sign in to comment.