Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

toast: element.remove() does not return promise #10379

@vertazzar

Description

@vertazzar

Actual Behavior:

  • What is the issue? *
    toast throws error when hiding if rapidly executing show
    the problem is the one-liner that handles that
    return ((options.$destroy == true) ? element.remove() : $animate.leave(element)).then(...
  • What is the expected behavior?
    do not throw the error

CodePen (or steps to reproduce the issue): *

Angular Versions: *

  • Angular Version: 1.6.1
  • Angular Material Version: 1.1.1 and 1.1.3

Additional Information:

  • Browser Type: * Chrome
  • Browser Version: * 55.0.2883.95
  • OS: * OSX
  • Stack Traces:
TypeError: (intermediate value)(intermediate value)(intermediate value).then is not a function
    at Object.onRemove (https://ajax.googleapis.com/ajax/libs/angular_material/1.1.1/angular-material.js:20861:10)
    at https://ajax.googleapis.com/ajax/libs/angular_material/1.1.1/angular-material.js:3524:46
    at u (https://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular.min.js:135:446)
    at hideElement (https://ajax.googleapis.com/ajax/libs/angular_material/1.1.1/angular-material.js:3521:18)
    at Object.transitionOutAndRemove [as remove] (https://ajax.googleapis.com/ajax/libs/angular_material/1.1.1/angular-material.js:3334:20)
    at Object.destroy (https://ajax.googleapis.com/ajax/libs/angular_material/1.1.1/angular-material.js:3268:34)
    at Object.destroyInterimElement [as destroy] (https://ajax.googleapis.com/ajax/libs/angular_material/1.1.1/angular-material.js:3089:40)
    at https://ajax.googleapis.com/ajax/libs/angular_material/1.1.1/angular-material.js:20427:18
    at b.$broadcast (https://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular.min.js:150:183)
    at b.$destroy (https://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular.min.js:146:180) Possibly unhandled rejection: {}
(anonymous) @ VM643 console_runner-5710c30….js:1
(anonymous) @ VM1359 angular.min.js:122
(anonymous) @ VM1359 angular.min.js:94
g @ VM1359 angular.min.js:133
f @ VM1359 angular.min.js:47
(anonymous) @ VM1359 angular.min.js:50

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions