Same "root" id for different fieldset or input
See original GitHub issueDescription
The default bootstrap/core theme renders multiple id
with the default root. This seems to be caused by https://github.com/rjsf-team/react-jsonschema-form/blob/75f734d8ec7beb29e60ac27ceaf6deadd2a71734/packages/core/src/components/fields/ObjectField.js#L33
Unfortunately, using a ObjectFieldTemplate
it is not easy to override the id
using the idPrefix
and property name
because both are not passed to the ObjectFieldTemplate
. So no easy workaround afais, instead needs a fix here. FWIW, btw I think it would be great if ObjectField
would also pass its name
to ObjectFieldTemplate
.
Steps to Reproduce
- Go to this playground
- Open devtools inspector
- Search for
#root
Expected behavior
There should only be one unique id
(also useful for anchors)
Actual behavior
There are six id=root
in the rendered markup
Version
2.0.1
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:6
Top Results From Across the Web
<fieldset>: The Field Set element - HTML - MDN Web Docs
This attribute takes the value of the id attribute of a <form> element you want the <fieldset> to be part of, even if...
Read more >Difference between id and name attributes in HTML
The name attribute is used when sending data in a form submission. Different controls respond differently. For example, you may have several ...
Read more >Using the fieldset and legend elements
It is possible to nest one <fieldset> element inside another, but it is not recommended. Screen readers do not automatically indicate the end...
Read more >Apollo Federation subgraph specification
Grammatically, a FieldSet is a selection set minus the outermost curly braces. It can represent a single field ( "upc" ), multiple fields...
Read more >FormControl API - Material UI - MUI
Learn about the props, CSS, and other APIs of this exported module. ... For instance, only one input can be focused at the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You are right, that was the problem. Thanks =)
Found the same problem when array of objects, solutions was the same - to add “object” type to “items”: