formio.js icon indicating copy to clipboard operation
formio.js copied to clipboard

Duplicate Id if multiple error messages

Open tkalmar opened this issue 1 year ago • 1 comments

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

tkalmar avatar Apr 03 '24 11:04 tkalmar

@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

olgabann avatar Apr 24 '24 13:04 olgabann