Issue
I've been looking around, and I can't find an answer to this. I would like to have a mat dialog box open when a customer just starts typing. No focus nor input. Just starts typing. I'm sure the answer is simple, but I just can't find it. Thanks in advance!
Solution
A simple host listener should do the trick:
@HostListener('window:keyup', ['$event'])
keyEvent(event: KeyboardEvent) {
this.openDialog();
}
Where openDialog
is the function that triggers your MatDialog.
Answered By - bamoure
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.