pqina / vue-filepond

🔌 A handy FilePond adapter component for Vue
https://pqina.nl/filepond
MIT License
1.93k stars 128 forks source link

[Bug] beforeRemoveFile not working (movie describing problem) #279

Closed mrkazmierczak closed 1 year ago

mrkazmierczak commented 1 year ago

Is there an existing issue for this?

Have you updated Vue FilePond, FilePond, and all plugins?

Describe the bug

This hook is not working. Just have a look at this movie. I have created hook as you mentioned @rikschennink and this is not working in vue-filepond.

https://youtu.be/ZGKL5g-bzD0

Reproduction

                            <file-pond v-if="item.id"
                                id="uploadedFiles" 
                                name="uploadedFiles" 
                                ref="pond" 
                                v-bind:files="filesContainer"
                                label-idle="Załaduj zdjęcia"
                                max-files="20" 
                                allowProcess="true"
                                allowFileSizeValidation="true" 
                                maxFileSize="10MB"
                                allow-multiple="true" 
                                allow-reorder="true"
                                accepted-file-types="image/png, image/jpeg, application/pdf, application/zip, application/octet-stream, audio/wav, image/tiff"
                                v-bind:server="{
                                    url: 'http://localhost:8000/api/files/',
                                    headers: {
                                        'Accept': 'application/json'
                                    },
                                    timeout: 7000,
                                    process: process,
                                    revert: revert,
                                    load: load,
                                    remove: remove,
                                    withCredentials: true,
                                    onerror: () => { },
                                    onprocessfiles: () => { },
                                    beforeRemoveFile: () => { alert('This is not working Rik!'); }
                                }" 

                                v-on:init="handleFilePondInit"
                                v-on:removefiles="handleFilePondRemove" 
                                v-on:updatefiles="handleFilePondUpdate" 
                                v-on:reorderfiles="handleFilePondReorder"
                                v-on:processfile="handleFilePondProcessFile"
                                v-on:processfiles="handleFilePondProcessFiles"
                                v-on:processfilestart="handleFilePondProcessFileStart" 

                                />

Environment

- Device: mac
- OS:mojave
- Broser: chrome
- Vue version: 3
rikschennink commented 1 year ago

https://codesandbox.io/s/vue-filepond-live-demo-forked-jiv95t?file=/src/components/FilePondDemo.vue

test method runs?

mrkazmierczak commented 1 year ago

Hi Rik! thank you for your answer. For better start on Monday I've send you 3xcoffee boost. This v-bind is working as expected. Now I can finish my uploader and I'll create complete tutorial how to run FilePond with vue-filepond. Thank you so much and have a nice week.