Skip to content
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

[Feature] FileInput controlled state without file data #895

Open
wants to merge 20 commits into
base: develop
Choose a base branch
from

Conversation

LJKaski
Copy link
Collaborator

@LJKaski LJKaski commented Jan 28, 2025

Description

This PR brings a new feature to FileInput, which allows it to be used in controlled state without having to store the actual file data in the component state. This can be accomplished by providing the component with an object with the necessary metadata, and storing the actual file elsewhere.

Motivation and Context

This was a request from several projects, where there were forms with possibly tens of files added. Storing the actual file data in the component state got really unoptimal in those cases.

How Has This Been Tested?

Tested locally on styleguidist on chrome as well as in a React+Vite test project. Also tested in one of the projects that requested this feature.

Release notes

FileInput

  • File is no longer required in ControlledFileItem
    • Providing the necessary metadata for the component is now enough, which provides more flexibility in terms of where to store the file itself

@LJKaski LJKaski added the enhancement New feature or request label Jan 28, 2025
@LJKaski LJKaski self-assigned this Jan 28, 2025
@LJKaski LJKaski requested a review from riitasointi as a code owner January 28, 2025 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

1 participant