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

Issue with progress bar causing infinite loop #1026

Open
sorcamarian opened this issue Sep 13, 2024 · 1 comment
Open

Issue with progress bar causing infinite loop #1026

sorcamarian opened this issue Sep 13, 2024 · 1 comment

Comments

@sorcamarian
Copy link

Please check https://stackoverflow.com/questions/78595897/angular-ngx-toastr-progress-bar-causes-infinite-loop

@sorcamarian
Copy link
Author

I'm using ngx-toastr in my Angular 18 project to display success messages with a progress bar. However, enabling the progress bar causes a re-rendering loop, preventing event execution. Here's my setup:

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

I also tried to run outside Zone.js with this

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

The issue only occurs with the progress bar enabled. I've tried running the toast setting onActivateTick to false, but the problem persists.

It is probably relating to the animation of the progress bar. When a toast is active, the other events don't work because of the loop caused on the template. However having more toaster notification with progress bar works in their example https://ngx-toastr.vercel.app/

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