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

Do not output conditionally revealed content for radios or checkboxes when it's empty #1595

Merged
merged 1 commit into from
Sep 27, 2019

Conversation

36degrees
Copy link
Contributor

If item.conditional.html is falsy, perhaps because it’s referencing a variable that is conditionally assigned, the macro currently outputs an empty div.govuk-checkboxes__conditional and associates it with the input using aria-controls.

By testing for item.conditional.html being truthy (which is the only property in the item.conditional object used within the macro) we can avoid this.

Fixes #1546

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-1595 September 27, 2019 08:33 Inactive
@36degrees 36degrees force-pushed the omit-empty-conditionals branch from 1cbb063 to 08c96e0 Compare September 27, 2019 08:33
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-1595 September 27, 2019 08:33 Inactive
If `item.conditional.html` is falsy, perhaps because it’s referencing a variable that is conditionally assigned, the macro currently outputs an empty `div.govuk-checkboxes__conditional` and associates it with the input using aria-controls.

By testing for `item.conditional.html` being truthy (which is the only property in the item.conditional object used within the macro) we can avoid this.
Copy link
Contributor

@NickColley NickColley left a comment

Choose a reason for hiding this comment

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

Makes sense to me nice work 👍

@36degrees 36degrees merged commit 4607dda into master Sep 27, 2019
@36degrees 36degrees deleted the omit-empty-conditionals branch September 27, 2019 09:47
@edwardhorsford
Copy link
Contributor

Woop! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Radios and checkboxes with empty conditionals causes odd spacing
4 participants