-
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
Access to DOM click event on Overlay backdropClicked emitter #9713
Labels
P4
A relatively minor issue that is not relevant to core functions
Comments
crisbeto
added
has pr
P4
A relatively minor issue that is not relevant to core functions
labels
Jan 31, 2018
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Jan 31, 2018
Exposes the click event object when subscribing to the `OverlayRef.backdropClick` stream. Fixes angular#9713.
tinayuangao
pushed a commit
that referenced
this issue
Feb 1, 2018
Exposes the click event object when subscribing to the `OverlayRef.backdropClick` stream. Fixes #9713.
Wow, that was fast! Thanks! |
mmalerba
pushed a commit
to mmalerba/components
that referenced
this issue
Feb 1, 2018
Exposes the click event object when subscribing to the `OverlayRef.backdropClick` stream. Fixes angular#9713.
Shouldn't the |
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Feb 8, 2018
…ective Exposes the `MouseEvent` from the backdrop click in the `ConnectedOverlayDirective.backdropClick` emitter. Relates to angular#9713.
jelbourn
pushed a commit
that referenced
this issue
Feb 12, 2018
…ective Exposes the `MouseEvent` from the backdrop click in the `ConnectedOverlayDirective.backdropClick` emitter. Relates to #9713.
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug, feature request, or proposal:
Feature Request
What is the expected behavior?
When using an Overlay from the CDK and the user clicks on the backdrop return the underlying DOM click event to backdropClicked() subscribers. This is useful in some scenarios where we might need to do something like
event.preventDefault();
What is the current behavior?
The backdropClicked() event emitter doesn't include the dom click event when it emits (it emits null),
https://github.com/angular/material2/blob/master/src/cdk/overlay/overlay-ref.ts#L279-L281
What are the steps to reproduce?
Create an Overlay, and subscribe to it's BackdropClicked() event emitter. Click on the backdrop, and see that the next callback receives
null
instead of the dom click event.What is the use-case or motivation for changing an existing behavior?
It may be useful to
stopPropigation()
orpreventDefault()
when clicking on the backdrop of an overlay. But we can't do that if the DOM event for the click is not passed on to the backdropClicked() subscriber.Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular 5.2.2, CDK v5.1.0
Is there anything else we should know?
The text was updated successfully, but these errors were encountered: