Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

MultiUpload: HTML output - place error and input elements outside of the label element #352

Closed
brightpixels opened this issue Sep 30, 2022 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@brightpixels
Copy link
Collaborator

brightpixels commented Sep 30, 2022

Is your feature request related to a problem? Please describe.
We are using the MultiUpload component and based on GDS guidelines, we expecting the HTML output to be in a certain way.

The MultiUpload html output is:
<label class="govuk-label" aria-controls="multiupload-id" for="multiupload-id"> <span>Upload the CSV file from your device</span> <span id="file-error-message" class="govuk-error-message">The selected file must be a CSV</span> <input type="file" id="multiupload-id" name="productCsvFile" accept=".csv" class="govuk-file-upload"> </label>

However, GDS output is (inspect the html): https://design-system.service.gov.uk/components/file-upload/error/index.html

Describe the solution you'd like
Error and input tags to be located outside the label element to match output of GDS https://design-system.service.gov.uk/components/file-upload/error/index.html

Please follow the following instruction to create the new branch:

git checkout release/0.6
git pull
git checkout -b 'feature/multi-html'
@brightpixels brightpixels changed the title MultiUpload: HTML output MultiUpload: HTML output - place error and input elements outside of the label element Sep 30, 2022
@daniele-zurico daniele-zurico added this to the 0.6 milestone Sep 30, 2022
@daniele-zurico daniele-zurico added the bug Something isn't working label Sep 30, 2022
@cg-julian-taylor
Copy link
Collaborator

@brightpixels Should the html match GDS spec exactly? The error text we return is a different structure to what is recommended. We use a <span> tag instead of a <p> tag.

@brightpixels
Copy link
Collaborator Author

Leave it as span as long we can pass a class and the order of the element is labal, error then the upload button, we should be good.

@daniele-zurico
Copy link
Contributor

PR merged

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants