This is a migrated thread and some comments may be shown as answers.

@HostListener('document:keydown.enter')

1 Answer 4717 Views
Dialog
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 16 Jul 2020, 03:42 PM

How do I go about using a Host Listener for a kendo-dialog? My team and I haven't had enough time to sit down and talk through this, and we've been busy with other things and pushing this aside. However, it has resurfaced, and this time it should probably get figured out.

1 Answer, 1 is accepted

Sort by
0
Svet
Telerik team
answered on 20 Jul 2020, 07:18 AM

Hi Andrew,

I am not sure that I understand what is the specific use - case scenario and what is required. Generally, the Angular @HostListener can be used to handle global events only for the window, document, body, and components host elements as stated in the following article extracted from StackOverflow:

https://stackoverflow.com/questions/41700724/angular2-hostlistener-how-can-i-target-an-element-can-i-target-based-on-class

Thus, it seems that what you are trying to achieve with the HostListener and the Dialog isn't supported by the framework. What could be done is to listen for Enter key press events globally or per component and check if there is currently a Dialog instance in order to perform any subsequent implementation. Could I ask you for some more details describing the use - case scenario and what should happen once the enter key is pressed. That will help us to better understand the specific scenario and we will be able to provide some further more specific suggestions. Thank you. We are looking forward to your reply.

Regards,
Svetlin
Progress Telerik

Tags
Dialog
Asked by
Andrew
Top achievements
Rank 1
Answers by
Svet
Telerik team
Share this question
or