Skip to content

[FEATURE REQUEST] Implementation of proper file input #1768

@ChronicStone

Description

@ChronicStone

This function solves the problem (这个功能解决的问题)

The upload component that already exists is useful, but it does not fit all use cases that users might have. I often come across cases where I need to manipulate directly the blob of the selected file, and handle its upload by myself later when I'm done doing what I need to do with the file locally.

On the other hand, the upload component is pretty well done, and cover a lot of use cases with all the options available UI-wise.

On the component side, you can set it to type "file", but it's the obvious the Input component has not been designed with this use case in mind (You can check out here how the input component handles file type : https://codesandbox.io/s/suspicious-wind-pfnlw).

Expected API (期望的 API)

From what I've seen, I see two possibilities :

  1. The first one would be to modify the current Upload component to implement this whole behaviour as an option, but It does not really make sense, as we're getting away from the original puropose of the component which is handling file upload

  2. The second option would be extract the UI of the Upload component as a standalone FileInput component

Let me know what you think about this, or if I can help in any way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions