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

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

Closed
vertazzar opened this issue Feb 7, 2017 · 1 comment · Fixed by #11917
Closed

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

vertazzar opened this issue Feb 7, 2017 · 1 comment · Fixed by #11917
Assignees
Labels
has: Pull Request A PR has been created to address this issue P3: important Important issues that really should be fixed when possible. resolution: fixed type: bug
Milestone

Comments

@vertazzar
Copy link

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
@Splaktar Splaktar changed the title toast - element.remove() does not return promise toast: element.remove() does not return promise May 25, 2020
@Splaktar Splaktar self-assigned this May 25, 2020
@Splaktar Splaktar added the P3: important Important issues that really should be fixed when possible. label May 25, 2020
@Splaktar Splaktar added this to the 1.1.23 milestone May 26, 2020
@Splaktar Splaktar added the has: Pull Request A PR has been created to address this issue label May 26, 2020
Splaktar added a commit that referenced this issue May 26, 2020
- this results in an exception
- add types for `$q`
- improve JSDoc

Fixes #10379
@Splaktar
Copy link
Member

Splaktar commented May 26, 2020

Thank you for the report and the details on why this was happening.

Reproduced with 1.1.22 in updated CodePen.

Posted a fix in PR ##11917.

@Splaktar Splaktar reopened this May 26, 2020
Splaktar added a commit that referenced this issue May 26, 2020
- this results in an exception
- add types for `$q`
- improve JSDoc

Fixes #10379
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
has: Pull Request A PR has been created to address this issue P3: important Important issues that really should be fixed when possible. resolution: fixed type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants