File upload fails the first time but works afterwards when in a slide-over
Ok I have this weird issue. Here is my setup
This is the custom action I'm using to show a slide-over on a table. It contains a custom component that has a form with a file upload.
this is the wrapper
Here is the form
Most of it is boilerplate, and it works fine when I use it in a page (I use the same wrapper). However, when I use this in a slide over as a custom action, the first time I try to upload an image, it fails and I get the following console error
At first I thought it might have been an issue with the table polling, but I've disabled it and the issue is still there.
If I try to upload something again, it works as expected. I know this is a weird issue, so any ideas are welcome.
4 Replies
Here is a gif of how it looks in practice
As you can see, it fails the first time, but works the second, without any changes (same file, same form, same modal)
Here's the error
I have a feeling you are loading the view opposed to the livewire view and the element Spatie is a livewire package I believe so it fails on first load until the assets are loaded
@toeknee Sorry can you elaborate a bit? I'm not sure what you mean 😦
I am loading a view in the custom action
but that view has a livewire component in it
is there a better way to do this?