Closed oddvalue closed 2 years ago
You need to call $this->form->fill()
in mount()
to initialise the form, as mentioned here.
@danharrin thanks. I'm still getting the error, though. See updates to example app: https://github.com/oddvalue/filament-upload-test
There's definitely something up with the filepond field, the styling doesn't look right on it. The images don't have any padding and the .file-list
element drops below the container.
I don't see these issues on the filepond website examples. Are you able to replicate this?
Yeah, I can replicate this. The reason why the file upload looks different is because we use "compact" mode by default in FilePond, which removes unnecessary padding. You can change this using ->panelLayout(null)
.
The exception in the console - I can confirm this is a bug introduced in #1689, but it shouldn't actually impact the file upload functioning.
@dmandrade do you know why the FilePond locale event is firing before the component is initialised? Any way to fix it?
@danharrin @oddvalue I suspect the problem is due to the order of scripts call.
@stack('scripts')
in /resources/views/layouts/app.blade.php .is
is called in the head right after app.js but app.js is deferred.
Try to put scripts before body close
<!-- Scripts -->
@livewireScripts
<script src="{{ mix('js/app.js') }}"></script>
@stack('scripts')`
I will do a PR do put a defer in filepond locale and check if pond exists before call setOptions()
@dmandrade moving the scripts to body close or removing defer from app.js doesn't appear to remove the error.
@danharrin thanks for the tip regarding the panellayout thing, the main reason I mentioned it was that the element dropping below the field will overlap any field under it. I've added a checkbox to the test repo if you want to see for yourself: https://github.com/oddvalue/filament-upload-test
The element appears above the checkbox and you can't click it. Can confirm that ->panelLayout(null)
fixes the issue, though.
@oddvalue Did you remove the "defer" tag from the script?
@dmandrade I did, same error unfortunately
PR #1787 check if filepond exists to prevent console warning.
@danharrin Can you check PR?
Great, thanks.
Package
filament/forms
Package Version
v2.10.16
Laravel Version
v8.83.2
Livewire Version
v2.10.4
PHP Version
8.1.2
Bug description
File upload field throws error due to
pond
being undefined. This only started happening today, the app I've been working on was working fine with the upload fields.Steps to reproduce
This bare install of Laravel with Filament Forms shows the error:
https://github.com/oddvalue/filament-upload-test
Relevant log output