Skip to content

Conversation

@enguerranws
Copy link
Collaborator

@enguerranws enguerranws commented Jan 27, 2023

Using this component, I thought some <label> related improvments could be useful:

  • a hideLabel prop: not documented on DSFR docs, but we could allow users to provide a valid label but hide it (using sr-only to make it still readable by screen readers).
  • removed aria-labelled attribute: as long as the label prop is mandatory and linked to the related input with htmlFor, I don't see why we should keep it.
  • I added the support of the type file input (https://www.systeme-de-design.gouv.fr/elements-d-interface/composants/ajout-de-fichier), wrapping it with a fr-upload-group : I was about creating a new component (to follow DSFR naming and docs), but it appears that Input and File are just the same, only the wrapper class is changing. Maybe we should create a File component that just wraps Input component?

@enguerranws
Copy link
Collaborator Author

Well, I think we should have a separate File component that wraps the Input component: at least, it could handle a max file size property, which makes a validation on the uploaded file (on onChange event).

@garronej
Copy link
Collaborator

garronej commented Feb 2, 2023

Sorry it took me a week to review this.
I'm doing it now

@garronej
Copy link
Collaborator

garronej commented Feb 2, 2023

Ok thank you for your contribution.
I'll merge this :)

@garronej garronej merged commit 3879633 into main Feb 2, 2023
sbourdon13 pushed a commit to sbourdon13/react-dsfr that referenced this pull request Aug 11, 2023
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.

3 participants