Napster2210 / ngx-spinner

A library for loading spinner for Angular 4 - 17.
https://napster2210.github.io/ngx-spinner/
MIT License
819 stars 138 forks source link

Change detection is fired unexpectedly on components that have a spinner when you press any key #259

Closed PacoToro closed 1 year ago

PacoToro commented 1 year ago

Hi, we are working on an application with many components and some of them show a local spinner. Some of these components use the "OnPush" change detection strategy for better performance. We recently noticed that the application's performance was very poor when users pressed keys to enter data in input forms. In testing we found that the problem comes from components that have a spinner, because they always trigger change detection when users press a key (in or out of an input). If we remove the spinner from the components, the change detection doesn't fire. This behavior was detected in versions >= 11 of ngx-spinner.

Here's a demo to try it out https://stackblitz.com/edit/ngx-spinner-bug?file=src/app/app.component.ts

Napster2210 commented 1 year ago

This has been fixed in v16. Could you please check and feel free to reopen if it still exists?