-
Notifications
You must be signed in to change notification settings - Fork 6.8k
feat(overlay): expose keydown events on the opened overlay #11867
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
feat(overlay): expose keydown events on the opened overlay #11867
Conversation
@@ -205,6 +205,9 @@ export class CdkConnectedOverlay implements OnDestroy, OnChanges { | |||
/** Event emitted when the overlay has been detached. */ | |||
@Output() detach = new EventEmitter<void>(); | |||
|
|||
/** Emits when there are keyboard events that are targeted at the overlay. */ | |||
@Output() keydownEvents = new EventEmitter<KeyboardEvent>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just keydown
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though it's very unlikely for someone to bind a keydown
to the overlay host, I wanted to avoid clashing with the native keydown
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about something like overlayKeydown
, then? The "Events" suffix doesn't match any of the other events in the library
Since the consumer doesn't have direct access to the overlay that is being opened, there's no way for them to listen for keyboard events. These changes expose the `OverlayRef.keydownEvents` via an output.
b9c6ed0
to
b061da0
Compare
Reworked based on the feedback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Since the consumer doesn't have direct access to the overlay that is being opened, there's no way for them to listen for keyboard events. These changes expose the `OverlayRef.keydownEvents` via an output.
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. |
Since the consumer doesn't have direct access to the overlay that is being opened, there's no way for them to listen for keyboard events. These changes expose the
OverlayRef.keydownEvents
via an output.