You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
onRemove will be executed when removing file button is clicked, remove event will be prevented when return value is false.
But, if we want't to popup a confirm dialog, it can't block the execution of onRemove.
So, I add Promise support for onRemove. The return value of onRemove now can be a Promise, and the handleRemove function in Upload can wait for the non-blocking confirm dialog.
What does the proposed API look like?
Example:
onRemove for Upload
onRemove: file => {
return new Promise((resolve, reject) => {
confirm({
title: 'are you sure to remove this file?',
onOk: () => {
resolve(true)
},
})
})
}
The text was updated successfully, but these errors were encountered:
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.
lockbot
locked as resolved and limited conversation to collaborators
May 2, 2018
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What problem does this feature solve?
onRemove will be executed when removing file button is clicked, remove event will be prevented when return value is false.
But, if we want't to popup a confirm dialog, it can't block the execution of onRemove.
So, I add Promise support for onRemove. The return value of onRemove now can be a Promise, and the handleRemove function in Upload can wait for the non-blocking confirm dialog.
What does the proposed API look like?
Example:
onRemove for Upload
The text was updated successfully, but these errors were encountered: