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

mdToast: success callback fired on toast timeout #3745

Closed
mckenzielong opened this issue Jul 15, 2015 · 4 comments
Closed

mdToast: success callback fired on toast timeout #3745

mckenzielong opened this issue Jul 15, 2015 · 4 comments
Assignees
Milestone

Comments

@mckenzielong
Copy link
Contributor

Overview of the Issue

Action toasts are firing the success call back when they are dismissed due to the timeout being reached / auto dismissing. This wasn't the case in 0.10, 0.9.8, etc.

Browsers and Operating System

Windows 7, Chrome 43.0.2357.132

Reproduce the error

Reproducible on the toast demo: https://material.angularjs.org/HEAD/#/demo/material.components.toast -- click the 'show with action' toast and wait for the toast to auto hide. The callback if fired and you are alerted that you clicked 'OK'

Related Issues

Might be related to #3704?

@ThomasBurleson ThomasBurleson added this to the 0.11.0 milestone Jul 15, 2015
@ThomasBurleson ThomasBurleson self-assigned this Jul 15, 2015
@ThomasBurleson ThomasBurleson added the needs: investigation The cause of this issue is not well understood and needs to be investigated by the team or community label Jul 15, 2015
@gkalpak
Copy link
Member

gkalpak commented Jul 15, 2015

This was an intentional change #3558.
The demo should probably be changed to say something else.

But, I think it might be useful to be able to differentiate between clicking the button and timing out.
Maybe resolving with a value of true vs false ?

@mckenzielong
Copy link
Contributor Author

But, I think it might be useful to be able to differentiate between clicking the button and timing out.
Maybe resolving with a value of true vs false ?

👍

The action button being clicked seems like a pretty common use case, which was more or less broken by #3558. Out of curiosity, was there a reason why it was changed from cancel to hide? Couldn't the promise's finally been used for the timeout?

@ThomasBurleson
Copy link
Contributor

@mckenzielong - The reason for this change is that a hide-action !== reject-response === cancel-action. I will be fixing this issue to be included with the pending 0.10.1-rc2.

@ThomasBurleson ThomasBurleson added resolution: fixed and removed needs: investigation The cause of this issue is not well understood and needs to be investigated by the team or community labels Jul 16, 2015
@ThomasBurleson
Copy link
Contributor

Internally all menu, dialog, and toast elements now resolve with 'true' for hide or timeout responses; unless overridden in the .hide(value) call. Toast click actions now resolve with 'ok'; see demo.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants