-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Toast component with duration doesn't dismiss if another toast is present. #6657
Comments
Hello, thanks for opening an issue with us! Ahh, good catch (: we will have to look into this. So there is a Toast component and an ionic-native toast plugin for a few reasons, but the main reason that stands out to me is that our toast component is more configurable and can be custom styled, as its just a regular angular2 component. Hope that helps! |
+1 |
Hello! If a toast is set to have a duration and has Example:
|
This issue doesn't seem to be corrected. I have a function
I also have a list of items that can be "liked" by clicking on an icon in the list. Whenever an item is "liked" the presentToast method is called.
If I "like" a single item I see the toast appear then disappear after the duration has passed. If I like several items in a row I see each toast appear, but only one will disappear (I can tell by the change in the stack of toasts opacity). Additionally, manually calling .dismiss() on the toast also does nothing.
|
@captainjim1 I can confirm this, version 3. |
@captainjim1 I narrowed to version 3.5.0. Are you using that by any change? By changing the version number in line 37 of systemjs.config.js to 3.5.1 you will see it working |
Interesting! I updated my package.json using the node app "npm-check-updates" (ncu -u; npm install).. it turns out I had a few other things out of date.
Thanks for the help! |
Any workaround for this issue? Whenever there are two toasts on top of each other, they won't be dismissed automatically. Kinda reluctant to upgrade Ionic version. Very often that I update the library, more issues coming out. So, I would hope to have a workaround. |
@AhSem sorry, no workaround except modifying the source. Although I agree updating ionic is one of the biggest pain points of the lib, I think the upgrade from 3.5 to 3.5.1 is relatively smooth |
Upgrading via the ionic cli was simple and without issue.. it fixes this problem. Also, if you are using proper source control then you should be able to revert to the older version if the upgrade doesn't work for you |
Is there a way I can dismiss the toast from a different function?
Here in this case I would like to call toastinstance function dynamically and get the toast dismissed. |
@sudharshanreddyam to close it you need the reference to the originally created toast. So if you expose the toast.create on your class you can call dismiss on it from another function. Or return it from the toastCreate function to get the reference |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Short description of the problem:
When a toast with a duration is displayed after another toast, the duration has no effects, the toast does not hide.
I was having the issue with my app and found the same issue on your toast component demo page.
What behavior are you expecting?
The toast with a duration should be dismissed anyway.
Steps to reproduce:
Which Ionic Version? 2.0.0-beta.7
Not really related question but why there is this Toast component and the ionic-native Toast plugin ? There are doing the same thing for me.
The text was updated successfully, but these errors were encountered: