174
rated 0 times
[
176]
[
2]
/ answers: 1 / hits: 15476
/ 6 Years ago, thu, may 24, 2018, 12:00:00
I need to remove focus from input text field from user with the ESC key press. I don't know how to do it with text input fields. Below code works perfectly to detect the ESC key is pressed.
// Triggered Listener to detect event raised from DOM.
@HostListener('document:keydown', ['$event']) onKeydownHandler(event:
KeyboardEvent) {
if (event.keyCode === 27) {
return false;
}
}
Anyone can help how to do??
Thanks
More From » angular