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

[Bug] Method 'onupdatefiles' doesn't recognize states updates #974

Open
2 tasks done
ssbouhejada opened this issue Apr 13, 2024 · 1 comment
Open
2 tasks done

[Bug] Method 'onupdatefiles' doesn't recognize states updates #974

ssbouhejada opened this issue Apr 13, 2024 · 1 comment

Comments

@ssbouhejada
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Have you updated FilePond and its plugins?

  • I have updated FilePond and its plugins

Describe the bug

The bug in method 'onupdatefiles' in filepond component properties, this function only takes the first initial values for any state in the code, and when the state value updated, the changes are not recognized inside the method.

Reproduction

  • Declare any state hook at the top of the component, for example in 'RegisterationForm' component i declared a boolean state 'formFlag' with initial value true.
  • Use the filepond component inside the 'RegisterationForm' component with property method 'onupdatefiles' in which you are console log the 'formFlag'.
  • At any point in the code do some change on the 'formFlag' state value into false, and then trigger 'onupdatefiles' method in filepond by deleting files for example, You will notice that the value will remain true and it's not recognizing the updates on the state, it only takes the initial value.

Environment

- Device: Dell
- OS: Windows 11
- Browser:Chrome Version 122.0.6261.129
@rikschennink
Copy link
Collaborator

Can you create a test case on Stackblitz? Might help make clear what's going on.

@rikschennink rikschennink removed the bug label Oct 16, 2024
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