-
Notifications
You must be signed in to change notification settings - Fork 6.8k
refactor(overlay): use component to render backdrop #6627
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
Conversation
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, just a couple nits
src/cdk/overlay/backdrop.ts
Outdated
|
||
constructor(private _element: ElementRef, private _renderer: Renderer2) {} | ||
|
||
_setClass(cls: string) { |
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.
I'd rename cls
to either cssClass
or just c
(cls
has a different meaning for me)
src/cdk/overlay/overlay-ref.ts
Outdated
@@ -127,7 +131,8 @@ export class OverlayRef implements PortalHost { | |||
* Returns an observable that emits when the backdrop has been clicked. | |||
*/ | |||
backdropClick(): Observable<void> { | |||
return this._backdropClick.asObservable(); | |||
return this._backdropInstance ? this._backdropInstance._clickStream.asObservable() : | |||
empty<void>(); |
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.
Since the function return type is Observable<void>
, you don't really need the asObservable
call
bd6f9c4
to
9a114f5
Compare
9a114f5
to
93a64b5
Compare
93a64b5
to
f2c1fa0
Compare
4cb861c
to
2dcf30e
Compare
@crisbeto Linter strikes again |
Fixed. |
@crisbeto CI looks unhappy again |
dbdc289
to
0a87d53
Compare
Alright, now the CI should be happy. |
8214290
to
d1eb5db
Compare
Rebased again. |
bc9f71c
to
254e770
Compare
Some Google teams are using |
254e770
to
5a42a9d
Compare
Rebased and re-added the |
5a42a9d
to
9373ff8
Compare
@crisbeto Did you want to rebase and work on getting this one in? |
bc9a464
to
a4e7e80
Compare
Rebased and fixed a few issues @josephperrott. |
Uses an Angular component to render the backdrop, instead of managing a DOM element manually. This has the advantage of being able to leverage the animations API to transition in/out, as well as not having to worry about the cases where the backdrop animation is disabled. These changes also enable the backdrop transition for the dialog (previously it would be removed immediately on close).
a4e7e80
to
fe28d4b
Compare
Going to close this since it's not a big priority and would need further investigation into presubmit failures |
Requesting for this issue to be reopened in light of issues highlighted in #11806 |
We ended up abandoning this because it caused many test failures for various google apps, meaning it would probably cause many more test failures for the community at large. |
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. |
Uses an Angular component to render the backdrop, instead of managing a DOM element manually. This has the advantage of being able to leverage the animations API to transition in/out, as well as not having to worry about the cases where the backdrop animation is disabled.
These changes also enable the backdrop transition for the dialog (previously it would be removed immediately on close).