-
Notifications
You must be signed in to change notification settings - Fork 359
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
Not showing unless hovering #605
Comments
i'm having the same issue |
By the way you've described what is happening, it sounds like it's not working properly unless you trigger change detection on the toast. Are you triggering the toast outside of change detection or outside of angular's zone? |
@yarrgh not that i know of, i've just followed the guide in https://github.com/scttcper/ngx-toastr#setup and https://github.com/scttcper/ngx-toastr#use Here is my code: Styles:
app.module.ts
form.component.ts
|
I was facing the same issue. But after digging for hours I was able to find the solution... Thanks |
@nikhilpatel7 thank you very much. This solved it for me |
duplicate of #602 probably |
I don't think this is specific to bootstrap. I performed my tests with a new angular-cli project without bootstrap and was able to get this strange behavior to happen. The behavior I saw is due to angular not populating the toast with the contents until change detection is ran (mouse over) |
Here a repo with the issue: https://github.com/yarrgh/test-toast-app I can't duplicate it on StackBlitz. If you run |
I think the issue I found may be separate from the OP but I'm not entirely sure until they respond. |
@yarrgh you don't have animations loaded? |
Touché. That's what I get by going too fast. I stopped once I "duplicated" the issue. |
My issue could be related to angular material or angular updates, it was working fine with bootstap. Just wanted to know if it was only me, thanks |
add this to your global style.css |
I am having the same issue, and I can confirm that the problem is a collision with bootstrap, cause when I commented out the bootstrap reference in my styles attribute on angular.json the toasts showed up fine. However, even when I added: #toast-container > div { to my global styles css (which I assume is app.component.css in an angular project) the issue kept on persisting. |
I had to do a few more things for this to work on my Angular + Bootstrap project, my styles.css looked like this: /* TOASTR BUGFIX */
#toast-container > div {
opacity: 1;
}
.toast {
font-size: initial !important;
border: initial !important;
backdrop-filter: blur(0) !important;
}
.toast-success {
background-color: #51A351 !important;
}
.toast-error {
background-color: #BD362F !important;
}
.toast-info {
background-color: #2F96B4 !important;
}
.toast-warning {
background-color: #F89406 !important;
} I hope this workaround help some of you guys. |
Im having the same issue but just only with first toastr. And looks like is an error of javascript, not css [SOLVED] |
Adding |
After combining what @abhaygawade and @Hernior advised it works for me. |
Found this in toastr.css :
Is it normal ? |
I am facing the same issue while using the latest Bootstrap 4.2.1. I tried all the workarounds given above but none of them fixed the issue. Anyone has tried the version of Bootstrap 4.2.1 and fixed the issue by any chance? |
I reproduced again the Module thing, with the corrective css on my styles.css and I can say that it works.
|
No need to override the ngx-toastr styling. If animation module properly set. This will manage opacity thing |
My modules are in the exact same order as you guys described, but nothing except css trick works... |
I can confirm that the issue is introduced when I upgrade bootstrap to 4.3.1. Reverting to my previous version of 4.1.3 solves the issue. Problem is that bootstrap uses the same class .toast with "opacity: 0;". Solution is to have this set in the toastr.css ".toast-container .toast " as "opacity: 1;" since it will overwrite the bootstrap style. Created a pull request #623 |
Another solution: don't import toast, if you don't use it in your project. My style.scss with latest bootstrap, excluding some files:
See: https://getbootstrap.com/docs/4.3/getting-started/theming/#importing |
[EDIT] Oh sorry, didn't see @Hernior 's comment from january 8th |
Just ran into this as well after updating to the latest version of Bootstrap. The snippet by @Hernior worked for me. Are there any plans to fix this? |
@deckerbd looking to make a bunch of breaking changes around the ivy release and make this fix a part of that. It requires breaking changes. The opacity: 1 isn't a good fix and ideally people wouldn't import toast styles they aren't using. If you're using bootstrap with scss you should not import the toast styles see #602 |
Can somebody try 9.2.0 and see if this works without needing to add the additional css? From my initial quick tests on an empty project using Bootstrap 4.3.1 and ngx-toastr 9.2.0 toasts are showing up without having to add the opacity css in my project. Edit |
🎉 This issue has been resolved in version 10.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Thank you Scott <3 |
Perfect! Thank you! |
you need to import BrowserAnimationsModule in app.module.ts import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; and also add that in the @NgModule imports array |
@pnutmath your answer solved the issue for me. Thank you soo much! |
I'm using ng9 with toastr 12.1.0. Trying to show a toast from a service listening to firebase messaging. Nothing here helped other than |
Thanks. This solved it for me. |
hi @nicolas-b12 Hi sir can you tell me how to add CSS dynamically on progress bar? |
It was working well but after some issues and updates of angular dependencies it won't show normally unless i hover it. Already tried without animation without success
The text was updated successfully, but these errors were encountered: