You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just found the clearOnUnmount option which give me the unmount behaviour I expect. Wonder why I never got unmount callback triggers in 2.x.x. I guess the bug is there rather than 3.0.0
I updated the CHANGELOG to better explain the change about onChange behaviour, also to clarify the main reason behind this change is because of a better handling of the initialFiles prop on mount, the event is also triggered on unmount when the clearOnUnmount prop is set to true.
Bug Report
Describe the bug
As of 3.0.0, the onChange method is fired on dropzone component mount, and also unmount with empty files array. This is undesirable.
Steps to reproduce
Code sandbox demo
Note alert on page load. Note alert on toggling dropzone off so that it is unmounted.
Expected behavior
No callback trigger on mount and unmount. I should only expect an onChange with empty files when a user has removed a file from dropzone.
Versions
@material-ui/core
version: latestmaterial-ui-dropzone
version: 3.0.0Additional context
The text was updated successfully, but these errors were encountered: