Is it possible to hide a header part on the FileUpload preview?
I would like to hide this part.
19 Replies
You can try via CSS.
@Dennis Koch a little bit unrelated question but also about FileUpload. I see that when someone drag & drop the images at least 2 livewire calls with form data related queries are executed when images switch the position. Is there any reason why this happens, or how to track down where it happens?
I got orderable on this Form element
It feels like a bug to me but not sure.
Not sure.
i dont think its a bug that livewire calls are made
we probably need to set the order in the backend and then get the image urls or something normal
Yeh but technically nothing is being saved here, just same data gets retrieved from the back-end and database when images shift positions. I have tried to track down where this originates but I could not.
it is being saved in the livewire state
hence why there are network requests
i really wouldnt worry about it
I would not if it was only media fetched from the database, but I also got some selects with relation and all of them get fetched too. As a result drag drop experience is not as smooth.
e.g. data for this gets refetched from DB when I do drag and drop and I can't understand how these relate.
They are on the same Livewire component and the state is hydrated as something changed.
the only query that is being run is to fetch options
Oh thought each component had their own state.
that shouldnt be expensive if your database is well indexed
fields have their own state, but they are rendered together because fields can be affected by each other
It's not but somehow drop feels like it hangs for half a second, might also be the added latency by the debugbar. π
disable the views collector in debugbar
also disable xdebug if you have that
Yeh, this seems to help.
@Dan Harrin is it possible to control that newly added image in a FileUpload would be appended at the end. I found it a little bit weird that first media item for SpatieMediaLibraryFileUpload is actually the last one but I am not sure if this by design or you flip keys to accommodate of how the FilePond works.
there is an appendFiles() method to allow that
its a weird filepond quirk
Gotcha, works perfectly!