-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix(menu): clean up the backdrop if the menu got destroyed mid-animation #8766
Conversation
@devversion Could you give me some feedback on this since you were dealing with the interim elements? |
@@ -60,13 +60,19 @@ function MenuProvider($$interimElementProvider) { | |||
$animate.enter(options.backdrop, $document[0].body); | |||
} | |||
|
|||
// Handles cases where the menu was destroyed, while it was animating. | |||
var destroyListener = scope.$on('$destroy', hideBackdrop); |
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.
It is quite unnormal to have a destroy listener inside of the interims onShow
method.
@crisbeto Having a Once the interim Element will be destroyed, the At #8727, an error will be thrown inside of a promise, which leads to a cancellation of the The error will be thrown, because the The fix would be function onRemove(scope, element, opts) {
opts.cleanupInteraction && opts.cleanupInteraction(); |
Thanks, I'll give it another shot. If I remember correctly, the onRemove wasn't firing yesterday. |
Sounds good! Yeah it will be triggered, I guess you checked the execution after the Runtime Exception. |
The menu backdrop wasn't being cleaned up, if the menu got destroyed while it was animating. Fixes angular#8727.
38e884a
to
dc2c553
Compare
That null check for the |
@crisbeto Yeah, you're actually using the fix, because you're triggering the interimElements This is definitely the perfect solution. LGTM! |
The menu backdrop wasn't being cleaned up, if the menu got destroyed while it was animating.
Fixes #8727.