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

File input inside a form improvements #1501

Merged
merged 12 commits into from Mar 2, 2023
Merged

Conversation

raquelarrojo
Copy link
Collaborator

@raquelarrojo raquelarrojo commented Feb 28, 2023

Checklist
(Check off all the items before submitting)

  • Build process is done without errors and all tests pass in /lib directory.
  • Self-reviewed the code prior to submitting.
  • Meets accessibility standards.
  • Added/updated documentation to /website as needed.
  • Added/updated tests as needed.

Purpose
Improve file input's documentation and behavior.

Description

  • Improved callbackFile description in props table.
  • Removed name from the input file to avoid that inconsistent data is received in submit inside a form.
  • Added type="button" to file item's delete button, since by default button type is submit. This would cause a problem when the file input is inside a form.
  • Changes basicUsage example to print files stateful variable instead of input file' files. Input file is uncontrolled and files are read only, so they do not contain files updated.
  • Added file input inside a form example.
  • Remove file input inside a form test, since we are not controlling what is arriving in submit event.

Closes #1492

@raquelarrojo raquelarrojo marked this pull request as ready for review March 1, 2023 09:25
@GomezIvann GomezIvann self-requested a review March 1, 2023 09:29
@GomezIvann GomezIvann self-assigned this Mar 1, 2023
@raquelarrojo raquelarrojo changed the title Changes file input File input inside a form improvements Mar 1, 2023
lib/src/file-input/FileInput.tsx Outdated Show resolved Hide resolved
lib/src/file-input/FileInput.tsx Outdated Show resolved Hide resolved
@GomezIvann GomezIvann merged commit a01bf75 into master Mar 2, 2023
@GomezIvann GomezIvann deleted the rarrojolopez-file-input branch March 2, 2023 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File Input bugs
2 participants