Skip to content
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

After changing toastClass when open multiple toasts, they appear on same position, not pilling up #981

Open
lucaspajarita opened this issue Mar 3, 2023 · 3 comments

Comments

@lucaspajarita
Copy link

lucaspajarita commented Mar 3, 2023

my toast config ToastrModule.forRoot({ timeOut: 5000, toastClass: 'toast-custom-style', preventDuplicates: true, newestOnTop: false })

my custom class 

toast-custom-style{ background-color: #47211e; background-clip: border-box; position: fixed; top: 14px; left: 14px; z-index: 99999; padding: 4px; word-wrap: break-word; white-space: pre-line; height: auto !important; width: 300px; border: 12px solid transparent; border-radius: 6px; border-image: url(./assets/ui/border_style_toast.png) 12 round; }

@prajwal-np
Copy link

. toast-custom-style { 
background-color: #47211e; 
background-clip: border-box; 
/* position: fixed; */
 /* top: 14px; */
  /* left: 14px; */
z-index: 99999; 
padding: 4px; 
word-wrap: break-word; 
white-space: pre-line; 
height: auto !important; 
width: 300px; 
border: 12px solid transparent; 
border-radius: 6px; 
border-image: url(./assets/ui/border_style_toast.png) 12 round;
 }

this will work. position: fixed is causing the issue as all the toast will have fixed position and given top and left.

@lucaspajarita
Copy link
Author

I'v been tried this, but without fixed position, all toasts are opening in bottom left. The positionClass option on app.module.js is not working when I change the toastClass

@lucaspajarita
Copy link
Author

lucaspajarita commented Mar 3, 2023

i Don't know why, but positionClass not working. Maybe something in my root scss causing this crash, but removing only position fixed, and remaing top and left, it's work correctly.

Final code:

``
ToastrModule.forRoot({
timeOut: 5000,
toastClass: 'toast-custom-style',
newestOnTop: true
})

.toast-custom-style{
background-color: #47211e;
background-image: none !important;
background-clip: border-box;
top: 14px;
left: 14px;
z-index: 99999;
padding: 4px;
word-wrap: break-word;
white-space: pre-line;
height: auto !important;
width: 300px;
border: 12px solid transparent;
border-radius: 6px;
border-image: url(./assets/ui/border_style_toast.png) 12 round;
}``

Tks prajwal-np :D

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

No branches or pull requests

2 participants