spatie / livewire-filepond

Upload files using Filepond in Livewire components
https://spatie.be/open-source
MIT License
194 stars 10 forks source link

[Bug]: Minor point: rogue console.log #10

Open mdcass opened 1 month ago

mdcass commented 1 month ago

What happened?

Rogue console.log at /resources/views/upload.blade.php#L67.

How to reproduce the bug

If you publish assets

php artisan vendor:publish --tag="livewire-filepond-views"

You will see the console.log in the resulting file on line 67.

Package Version

1.1

PHP Version

8.2

Laravel Version

11.9

Which operating systems does with happen with?

macOS

Notes

Unrelated to this bug (and I will raise another bug soon when I rule out it's just me being stupid) I found this console.log after publishing the view as I wanted to debug why my Filepond attributes aren't going through to the actual component:

<x-filepond::upload
    wire:model="file"
    max-files="5"
    multiple="true"
    credits="false"
    placeholder="Why am I not seeing this?"
/>

But we're not seeing what i'd expect (no placeholder set, it's still single file upload):

image
RoccoHoward commented 1 month ago

The localization change in https://github.com/spatie/livewire-filepond/pull/8 is causing this.

placeholder is set in labelIdle: @js($placeholder), (line 72) labelIdle is also in the localization files which is then set in pond.setOptions(@js($pondProperties)); line 79

I've pushed a fix by moving this option being set after localization

pond.setOptions({ labelIdle: @js($placeholder) });

l0gical commented 1 month ago

Would that be the similar reason why credits="false" as per the OP has no effect on their attached image.