pqina / jquery-filepond

🔌 A handy FilePond wrapper for jQuery
https://pqina.nl/filepond
MIT License
239 stars 43 forks source link

onreorderfiles Event is not triggering #17

Closed yongkyali closed 2 years ago

yongkyali commented 2 years ago

Summary

Hello, thank you for the amazing library! I have an issue with reorderfiles event it's not trigger whenever I re-order the items. Other events are working well without any issue. Tried this with Firefox and faced with same issue.

How to reproduce

<input id="images" class="filepond-custom-container" />

<script>
$('#images').filepond({
        name: 'chapter_images[]',
        allowMultiple: true,
        storeAsFile: true,
        required: true,
        allowReorder: true,
        itemInsertLocation: 'after',
});

// Working well
$('#images').on('FilePond:removefile', function (e) {
        console.log('remove is triggered', e);
});

// Not working
$('#images').on('FilePond:onreorderfiles', function (e) {
        console.log('the collection is just being reordered', e);
});
</script>

Expected behaviour

Event should be triggered.

Additional information

Environment Version
OS MacOS Monterey
Device Mac Mini M1
Browser Chrome Version 95.0.4638.69 (Official Build) (arm64)
rikschennink commented 2 years ago

It's reorderfiles instead of onreorderfiles

https://codesandbox.io/s/filepond-reorder-9v9bt?file=/src/index.js

yongkyali commented 2 years ago

But it written as onreorderfiles the current documentation. Screen Shot 2021-11-06 at 00 17 40

Correct me if I'm wrong. Because I tried to do it with plain javascript as written (which is onreorderfiles) and also not working.

rikschennink commented 2 years ago

I think that is a typo, looking into it.

rikschennink commented 2 years ago

Fixed the typo, should indeed be activefile and reorderfiles updated the codesandbox demo as well.