formio / formio.js

JavaScript powered Forms with JSON Form Builder
https://formio.github.io/formio.js
MIT License
1.83k stars 1.04k forks source link

Duplicate Id if multiple error messages #5555

Open tkalmar opened 3 months ago

tkalmar commented 3 months ago

Describe the bug When rendering a field with multiple error messages, the message div's get all the same Ids. This somewhat contradicts the idea of an id.

Version/Branch 4.19.1

To Reproduce Steps to reproduce the behavior: Use the kitchen-sink example: https://formio.github.io/formio.js/app/examples/kitchen.html

in the day field enter 45 for the day of month.

Inspect the IDs of the error messages:

<div class="form-text error" id="e-exyimwc-day">Day is required</div>
<div class="form-text error" id="e-exyimwc-day">Day is not a valid day.</div>

Expected behavior No duplicate IDs

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here. https://github.com/formio/formio.js/blob/4.19.x/src/templates/bootstrap/message/form.ejs the cause lies within this template i think, which does not account for multiple IDs

olgabann commented 2 months ago

@tkalmar Thank you for reporting this issue. I can reproduce it and have logged a ticket for the backlog. We are always willing to review any contributions to resolve this issue from the open-source community.

For internal reference: FIO-8256