Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

dlouhak
Copy link
Contributor

@dlouhak dlouhak commented Jun 10, 2024

No description provided.

@dlouhak dlouhak added the bug Something isn't working label Jun 10, 2024
@dlouhak dlouhak self-assigned this Jun 10, 2024
Copy link

netlify bot commented Jun 10, 2024

Deploy Preview for spirit-design-system-storybook canceled.

Name Link
🔨 Latest commit fa549de
🔍 Latest deploy log https://app.netlify.com/sites/spirit-design-system-storybook/deploys/6667245716f05100089f38b5

Copy link

netlify bot commented Jun 10, 2024

Deploy Preview for spirit-design-system ready!

Name Link
🔨 Latest commit fa549de
🔍 Latest deploy log https://app.netlify.com/sites/spirit-design-system/deploys/66672457f1eaeb0008d0fd84
😎 Deploy Preview https://deploy-preview-1465--spirit-design-system.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 96 (no change from production)
Accessibility: 93 (no change from production)
Best Practices: 100 (no change from production)
SEO: 82 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

helperText="{{ _helperText }}"
id="{{ 'item-helper-text' }}"
Copy link
Contributor Author

@dlouhak dlouhak Jun 10, 2024

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?

Copy link
Collaborator

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.

Copy link
Member

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

@coveralls
Copy link

Coverage Status

coverage: 74.051% (-3.7%) from 77.713%
when pulling 1c48fcb on fix/pass-missing-id-to-the-form-components
into cee0301 on main.

@coveralls
Copy link

Coverage Status

coverage: 96.911% (+19.2%) from 77.713%
when pulling e7b4dd6 on fix/pass-missing-id-to-the-form-components
into cee0301 on main.

@coveralls
Copy link

Coverage Status

coverage: 77.713%. remained the same
when pulling e7b4dd6 on fix/pass-missing-id-to-the-form-components
into cee0301 on main.

@coveralls
Copy link

Coverage Status

coverage: 96.911% (+19.2%) from 77.713%
when pulling fa549de on fix/pass-missing-id-to-the-form-components
into cee0301 on main.

@coveralls
Copy link

Coverage Status

coverage: 73.302% (-4.4%) from 77.713%
when pulling fa549de on fix/pass-missing-id-to-the-form-components
into cee0301 on main.

@dlouhak dlouhak changed the title Feat(web-twig): Pass missing id attributes to the form components Fix(web-twig): Pass missing id attributes to the form components Jun 10, 2024
@@ -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>
Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented in #1470

@crishpeen
Copy link
Member

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.

@literat literat closed this Jun 12, 2024
@literat literat deleted the fix/pass-missing-id-to-the-form-components branch June 12, 2024 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants