F
Filamentβ€’2y ago
Crylar

Is it possible to hide a header part on the FileUpload preview?

I would like to hide this part.
19 Replies
Dennis Koch
Dennis Kochβ€’2y ago
You can try via CSS.
Crylar
CrylarOPβ€’2y ago
@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?
Crylar
CrylarOPβ€’2y ago
Crylar
CrylarOPβ€’2y ago
I got orderable on this Form element It feels like a bug to me but not sure.
Dennis Koch
Dennis Kochβ€’2y ago
Not sure.
Dan Harrin
Dan Harrinβ€’2y ago
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
Crylar
CrylarOPβ€’2y ago
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.
Dan Harrin
Dan Harrinβ€’2y ago
it is being saved in the livewire state hence why there are network requests i really wouldnt worry about it
Crylar
CrylarOPβ€’2y ago
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.
Crylar
CrylarOPβ€’2y ago
e.g. data for this gets refetched from DB when I do drag and drop and I can't understand how these relate.
Dennis Koch
Dennis Kochβ€’2y ago
They are on the same Livewire component and the state is hydrated as something changed.
Dan Harrin
Dan Harrinβ€’2y ago
the only query that is being run is to fetch options
Crylar
CrylarOPβ€’2y ago
Oh thought each component had their own state.
Dan Harrin
Dan Harrinβ€’2y ago
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
Crylar
CrylarOPβ€’2y ago
It's not but somehow drop feels like it hangs for half a second, might also be the added latency by the debugbar. πŸ™‚
Dan Harrin
Dan Harrinβ€’2y ago
disable the views collector in debugbar also disable xdebug if you have that
Crylar
CrylarOPβ€’2y ago
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.
Dan Harrin
Dan Harrinβ€’2y ago
there is an appendFiles() method to allow that its a weird filepond quirk
Crylar
CrylarOPβ€’2y ago
Gotcha, works perfectly!
Want results from more Discord servers?
Add your server