Skip to content

Dynamic lists should make all child names and IDs unique by default. #908

@lud-hu

Description

@lud-hu

Reproduction

https://formkit.link/aa66d488506d69aa9360806f1a58f3cf

Describe the bug

When having multiple radios in a dynamic list, the id's for the html elements will not be unique:

<fieldset class="formkit-fieldset" id="input_2">
  <input class="formkit-input" type="radio" name="test" id="test-option-a" value="a">
  <input class="formkit-input" type="radio" name="test" id="test-option-b" value="a">
</fieldset>
...
<fieldset class="formkit-fieldset" id="input_4">
  <input class="formkit-input" type="radio" name="test" id="test-option-a" value="a">
  <input class="formkit-input" type="radio" name="test" id="test-option-b" value="a">
</fieldset>

This will cause the UI to do weird things, even if the state is properly handled by formkit.

image

Environment

• OS: [e.g. iOS]
• Browser [e.g. chrome, safari]
• Version [e.g. 22]

Metadata

Metadata

Labels

🚀 release-readyFeature or fix is complete and on an upcoming release branch🪄 enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions