-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix(web-twig): Pass missing id
attributes to the form components
#1465
Conversation
✅ Deploy Preview for spirit-design-system-storybook canceled.
|
✅ Deploy Preview for spirit-design-system ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
helperText="{{ _helperText }}" | ||
id="{{ 'item-helper-text' }}" |
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.
Temporary state. I know we shouldn't use same ID on the page more than once…
I'm not sure how to handle passing id
if the component Item
doesn't accept one. Use label in the kebab-case syntax, or extend API?
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.
I have tried to do this the same way as in all other components, but since the is
is not mandatory it is hard to say. Maybe the easiest way to fix this is just to set id
as required for the Item
component.
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.
I made the ValidationText and HelperText optional, so this is no longer needed. See #1470
id
attributes to the form componentsid
attributes to the form components
@@ -12,10 +12,10 @@ | |||
<!-- Render checked --> | |||
<label for="example-id-checked" class="Checkbox"><input type="checkbox" id="example-id-checked" class="Checkbox__input" checked> <span class="Checkbox__text"><span class="Checkbox__label">Example | |||
label</span></span></label> <!-- Render with helper text --> | |||
<label for="example-id-helper" class="Checkbox"><input type="checkbox" id="example-id-helper" class="Checkbox__input"> <span class="Checkbox__text"><span class="Checkbox__label">Example label</span> <span class="Checkbox__helperText">Example helper text</span></span></label> <!-- Render with hidden label --> | |||
<label for="example-id-helper" class="Checkbox"><input type="checkbox" id="example-id-helper" class="Checkbox__input"> <span class="Checkbox__text"><span class="Checkbox__label">Example label</span> <span class="Checkbox__helperText" id="example-id-helper__helperText">Example helper text</span></span></label> |
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.
It looks like we are missing the aria attribute too. Afaik it should be aria-describedby. @adamkudrna
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.
Implemented in #1470
...web-twig/src/Resources/components/Item/__tests__/__snapshots__/itemHelperText.twig.snap.html
Show resolved
Hide resolved
I created a new PR #1470 to solve the issue because I took a slightly different approach. If we merge it, we can close this one. |
No description provided.