Capgemini / dcx-react-library

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

fix: removing unnecessary div from error message #636

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

codecov-commenter commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (9f532f2) to head (5abe53a).

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## release/1.0.0 #636 +/- ## =============================================== Coverage 100.00% 100.00% =============================================== Files 85 85 Lines 1549 1554 +5 Branches 544 547 +3 =============================================== + Hits 1549 1554 +5 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.