-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help elements need a predictable ID #2360
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks -- are there any similar changes that could / should be done for other themes' help elements as well?
It doesn't look like many of the templates actually override the Help field. I don't know anything about semantic-ui, but take a look at FieldTemplate.js in semantic-ui. Right now it's got the following: I'll try to dig a bit and understand where it's getting "id" from in this context. |
@epicfaace anything else I need to do here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This looks great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, maybe we should add some snapshot tests for the themes with help fields? Just so we make sure that in the future, help fields always have ids that end with "__help" and this doesn't regress.
Reasons for making this change
When a ui:help is added to uiSchema for a property, the generated p or div tag needs to have an id attribute so it addressable. This same thing already exists for description fields. This is needed for association with the corresponding form fields for accessibility (like adding aria-describedby="helpId") on the associated input fields.
Checklist
Deploy preview
Once CI finishes, you should be able to view a deploy preview of the playground from this PR at this link: https://deploy-preview-[PR_NUMBER]--rjsf.netlify.app/