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

Triggering a toast creates loop #1019

Open
sorcamarian opened this issue Jun 8, 2024 · 3 comments
Open

Triggering a toast creates loop #1019

sorcamarian opened this issue Jun 8, 2024 · 3 comments

Comments

@sorcamarian
Copy link

I have a click event watching and when triggered it shows a success toast.
It has a global timeout of 5000ms.
During this millisecond the elements keep re-rendering and prevents event execution

@sorcamarian
Copy link
Author

Is there a way to run toaster outside of Zone?

I tried

 this._ngZone.runOutsideAngular(() => {
     this.toastr.success('Toastr fun!');
 });

And it still creates a loop

@sorcamarian
Copy link
Author

I noticed that this happens only when the progress bar is enabled.

    ToastrModule.forRoot({
      timeOut: 5000,
      positionClass: 'toast-top-right',
      preventDuplicates: false,
      progressBar : true,
      closeButton : true
    })
   
    ```

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

1 participant