-
Notifications
You must be signed in to change notification settings - Fork 3.4k
$mdToast increases watchers but does not remove them if multiple toasts are displayed within a digest. #5193
Comments
@ThomasBurleson please review and Triage. |
Hello @robertbaker. If your problem is that the toasts are not leaving then this should solve your problem. var toast = $mdToast.simple()
.content(message)
.action(action)
.highlightAction(false)
.position('bottom left');
setTimeout(function() {
$mdToast.show(toast);
}, 99); ` I encountered this problem before, where two events would trigger a toast and the second one would be left. |
@samuelchristopher No that's not the issue, there is a watcher leak, nothing to do with the UI. |
I encountered this issue when calling this event two times as it gets triggered twice sometimes: and listening on it: For reference, the service function
In this case, the toast simply does not go away. |
This may be related to #6633, since multiple toasts are shown within the same interim element. When this bug is fixed, then the toasts will probably hide. |
This bug is more about unattaching the events, disposing them so the number If you open 5 toasts at the same time, the number of watchers increase but On Wed, Mar 23, 2016, 7:25 AM Paul Gschwendtner [email protected]
|
@robertbaker Exactly, and thats caused by the current interim element stack. Because we are just trashing previous element in the stack. That means, no close execution -> no event cleanup. |
This issue is closed as part of our ‘Surge Focus on Material 2' efforts. |
Hitting this issue as well, has anyone got a workaround since it seems to be "deprecated"? |
This is kind of hard to explain, bare with me.
Using $mdToast, if you click one of the buttons to display a toast, rapidly enough so the toast does not disappear between clicks (and multiple toasts are created within 1 digest cycle), it will increase the watcher count considerably but will not remove all of the watchers for all of the toasts.
$mdToast only decreases the watchers for the last toast created within a digest cycle.
Demo: http://codepen.io/anon/pen/avLPqP
The text was updated successfully, but these errors were encountered: