Skip to content

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

Merged
merged 1 commit into from
Jul 10, 2018

Conversation

crisbeto
Copy link
Member

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.

@crisbeto crisbeto requested a review from jelbourn as a code owner June 20, 2018 20:46
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jun 20, 2018
@@ -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>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just keydown?

Copy link
Member Author

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.

Copy link
Member

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

@josephperrott josephperrott added the target: minor This PR is targeted for the next minor release label Jun 26, 2018
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.
@crisbeto crisbeto force-pushed the overlay-directives-keydown-event branch from b9c6ed0 to b061da0 Compare June 29, 2018 16:17
@crisbeto
Copy link
Member Author

Reworked based on the feedback.

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Jun 29, 2018
@jelbourn jelbourn merged commit a831bf6 into angular:master Jul 10, 2018
victoriaaa234 pushed a commit that referenced this pull request Jul 25, 2018
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.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants