i have a tip to clear the input; https://talltips.novate.co.uk/livewire/livewire-file-uploads-using-s3
setting $logo to null should suffice but I guess you are saying that you don't get chance to clear it because of the validation?
I have a public property called $logo;. I also have two validations in place: mimes and max. When a validation fails, e.g. the image format is not supported or the image is too big, the component still renders the $logo property and generates the temporaryUrl().
That seems kind of wrong. So if the image upload would fail, I don't want to image to be shown. How could I prevent that?
So the following is rendered on updated, even though the validation fails correctly.
@if ($logo)
<div class="image__preview">
<img src="{{ $logo->temporaryUrl() }}" alt="" width="150">
</div>
@endif
Also, due to the nature of the HTML file field, the selected file-input is not being reset when validation fals. But I think I have to do that manually with browser events, right?
perhaps only show the logo if $logo is set AND there are no validation errors
Please or to participate in this conversation.