Is this is bug?:
When a FilePond is hidden loaded with remote sources, it will not update the internal form data after the FilePond is set to visible. In other words, the FilePond needs to be seen in the browser to load existing data. When it is hidden, it will download the remote file, but will not add/populate the hidden form field.
We have accordions on our site, which can go open en closed. When they are closed, the content inside the accordion is not visible. When the main form is submitted, the FilePond file field is missing in the form.
If we load the form again, and open the accordion to show the FilePond, the remote file is then shown in FilePond and the form field is added. And submitting the main form works like expected.
In the above situation of showing the FilePond and then hiding again, does also work. Because FilePond has updated itself and added the form field to the main form and can be submitted also when the accordion is closed again.
That when a remote file is loaded, the hidden form field should always be added. It looks like the process of loading existing content is halted until FilePond is set to visible.
We do see the remote call to the content being done by the browser. So it is loaded, but not further processed.
| Environment | Version
|------------- | -----------
| OS | Linux Mint 19.1 (Ubuntu 18.04)
| Device | Desktop
| Browser | FireFox 65 (64bit)
Hi, yes it currently doesn't draw when it's invisible. Will see if I can work around this in some way.
Cool and thanks. I am hoping this is not a browser behavior.
No, It's checking if it's visible and if not, it won't render. But this unfortunately also means it won't render hidden elements... That's the part that needs fixing.
Just taken a quick look, it's not something that is easily fixed.
I advise to render the hidden input fields manually and then when the accordion becomes visible create the filepond instance and remove the hidden input fields. Not ideal, but should be possible with a bit of JavaScript.
Hmm, ok. We had already had a workaround for this. We just added the hidden field with code. And when posting the data, we just ignore the second field... a bit tricky, but seems to work for now
Will this be changed somewhere in the future? Or is it a feature that will not make it?
Alright, glad to hear that. I labeled it as a bug so will fix eventually.
The same seems to be true with events triggering.
For example, although I can start a filepond instance with .files property (and it should load those files) while triggering the .onaddfile, no events are being called simply because my filepond starts inside a collapsed panel (bootstrap).
I'm assuming that has to do with the previewer not triggering those events, since it doesn't load the image while not being visible, but that's also an issue for me.
Should be fixed in version 4.4.4, please confirm.