-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question] cdk keycodes #7358
Comments
Closing as the discussion and explanations are available in the prs linked above. |
@willshowell Although PR #3082 demonstrates the usage of Both approaches work just fine, the one is just way more code than the other. And I'm curious based on what the decision was made :) |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Whats the idea behind using the keycodes in here ?
I was looking at your implementation of the dialog and have noticed you are using it to for example detect when the user pressed escape.
You do that in a rather interesting way, you add an event listener to the document which executes a method which eventually checks the keycode.
My question is, why did you prefer this approach for handling keydown events instead of using HostListener like this.
@HostListener('document:keydown.Escape', ['$event']) ...
I am fully aware of the fact I should be on Stackoverflow for questions, but this question is related to internal code rather than the usage of it, therefor I thought this would be a better place.
The text was updated successfully, but these errors were encountered: