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

Change detection non working for side-effects triggered by onFileDrop when destroying component #225

Open
ellesse opened this issue Feb 23, 2021 · 1 comment

Comments

@ellesse
Copy link

ellesse commented Feb 23, 2021

ngx-file-drop: 11.0.2

Used in conjunction with @ngrx/store, @ngrx/effects and @ngrx/entity (10.1.2).

Description of the issue:

  • The onFileDrop emitted event triggers an action that in its turn starts a side effect to upload the content of the file
  • while the content is uploaded, the ngx-file-drop component is removed from the parent view (the component itself being wrapped inside an *ngIf directive whose clause becomes false).
  • After the content upload operation is successfully completed, the store is correctly updated and the observables bound to store features emit the new values as expected. Despite this, change detection in the parent component is not working anymore, with async pipes not returning the new emitted values, unless the user performs some action (e.g. button click) that triggers a new state change.
  • if the file is uploaded by using the native file input, the issue does not occur and the view is updated correctly.
  • The issue also does not occur if the ngx-file-drop is just hidden with display:none and not removed during the content upload operation.
@ellesse ellesse changed the title Change detection non working for side-effects triggered by droppedFile when destroying component Change detection non working for side-effects triggered by onFileDrop when destroying component Feb 23, 2021
@jcarlin
Copy link

jcarlin commented Jul 7, 2021

Yep, I can confirm, we are experiencing the same thing here.

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