-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Callback when multiple files added widget in react #326
Comments
So it seems like this is the way onDialogOpen={(dialog) => {
dialog.fileColl.anyDoneList.add((_, item) => {
console.log(item); // {uuid, name, size, isStored, isImage, …}
});
}} |
@aquaductape yes, onDialogOpen={(dialog) => {
dialog.fileColl.onAdd.add((file) => {
console.log("File added: ", file);
});
dialog.fileColl.onRemove.add((file) => {
console.log("File removed: ", file);
});
}} |
The onAdd and onRemove code is not true, it doesn't return a file, but instead a different object with a lot of methods.
I can't find the file on that object, the closest thing i can find relating to the file is the second parameter that's passed but is a number which is the index of the file. dialog.fileColl.onAdd.add((obj, fileIndex) => {
console.log("File added: ", fileIndex);
});
dialog.fileColl.onRemove.add((obj, fileIndex) => {
console.log("File removed: ", fileIndex);
}); |
Ok you have to call the promise method onDialogOpen={(dialog) => {
dialog.fileColl.onAdd.add(async (state) => {
const file = await state.promise()
console.log("File added: ", file);
});
dialog.fileColl.onRemove.add(async (state) => {
const file = await state.promise()
console.log("File removed: ", file);
});
}} |
Question
Similar to this #290, but on onFileSelect only fires after you close dialog. Is there an callback that fires as soon as each file finishes downloading and you can access updated
fileInfo
?The text was updated successfully, but these errors were encountered: