Capgemini / dcx-react-library

React Library UI/UX agnostic
https://main--6069a6f47f4b9f002171f8e1.chromatic.com
MIT License
107 stars 7 forks source link

631 forminput an aria attribute has been given an invalid value #635

Closed Ibabalola closed 2 months ago

Ibabalola commented 2 months ago

When rendering the form input I noticed the empty error div was still rendered on page load

<div class="dcx-form-input govuk-form-group">
   <label for="userReference">some label</label>
   <div class="dcx-error-message"></div> <!-- this container div is not required -->
   <div class="dcx-hint govuk-hint">some hint</div>
   <input name="userReference" type="text" class="govuk-input" tabindex="0" id="userReference" value="">
</div>

Screenshot 2024-04-19 at 13 53 38

This PR remove this such that the error div containing the error message is rendered only when needed