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
I have searched the issues of this repository and believe that this is not a duplicate.
What problem does this feature solve?
Our use case for this is to offer a file uploader with a "replace" button that does remove add at once(we have restricted the file uploader to only a single file for this use case).
In addition we are looking to combine this and the download and remove buttons into a dropdown menu with the full names of each operation written out. This also has problems from the same source.
It is not currently possible to use the Upload itemRender prop for this if you need to be able to manipulate the fileList after adding files to it.
There are workarounds such as:
Extracting the handlers by inspecting the props of the returned item
Replicate the fileList manipulation logic.
Both of these are comparable work to just building a file list from scratch.
What does the proposed API look like?
The solution is to expose the bound file actions to the renderer. The following is the proposed type changes:
Note: this API isn't the easiest to work with given the 4 arguments, however there aren't that many options that don't violate the contract of the existing API. Some alternatives that would also work:
Put the methods on the file objects in the code that calls itemRender (this is pretty expensive and may cause issues for existing implementations that rely on the object identity being stable)
Allow you to pass in a Component instead of a render function and use different logic in that case.
The text was updated successfully, but these errors were encountered:
What problem does this feature solve?
Our use case for this is to offer a file uploader with a "replace" button that does remove add at once(we have restricted the file uploader to only a single file for this use case).
In addition we are looking to combine this and the download and remove buttons into a dropdown menu with the full names of each operation written out. This also has problems from the same source.
It is not currently possible to use the Upload
itemRender
prop for this if you need to be able to manipulate the fileList after adding files to it.There are workarounds such as:
item
fileList
manipulation logic.Both of these are comparable work to just building a file list from scratch.
What does the proposed API look like?
The solution is to expose the bound file actions to the renderer. The following is the proposed type changes:
Note: this API isn't the easiest to work with given the 4 arguments, however there aren't that many options that don't violate the contract of the existing API. Some alternatives that would also work:
file
objects in the code that callsitemRender
(this is pretty expensive and may cause issues for existing implementations that rely on the object identity being stable)The text was updated successfully, but these errors were encountered: