Skip to content

Commit

Permalink
Addresses issues raised in review
Browse files Browse the repository at this point in the history
- It shouldn't really be needed in the README
- Add single quotes around HTML attribute names
  • Loading branch information
aliuk2012 committed Nov 5, 2018
1 parent 9d156dc commit 9cceaae
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 44 deletions.
42 changes: 0 additions & 42 deletions src/components/checkboxes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -510,48 +510,6 @@ Find out when to use the checkboxes component in your service in the [GOV.UK Des
]
}) }}

### Checkboxes with single option set aria-describeby on input

[Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/checkboxes/with-single-option-set-aria-describeby-on-input/preview)

#### Markup

<div class="govuk-form-group govuk-form-group--error">

<span id="t-and-c-error" class="govuk-error-message">
Please accept the terms and conditions
</span>

<div class="govuk-checkboxes">

<div class="govuk-checkboxes__item">
<input class="govuk-checkboxes__input" id="t-and-c-1" name="t-and-c" type="checkbox" value="yes" aria-describedby="t-and-c-error">
<label class="govuk-label govuk-checkboxes__label" for="t-and-c-1">
I agree to the terms and conditions
</label>
</div>

</div>

</div>

#### Macro

{% from "checkboxes/macro.njk" import govukCheckboxes %}

{{ govukCheckboxes({
"name": "t-and-c",
"errorMessage": {
"text": "Please accept the terms and conditions"
},
"items": [
{
"value": "yes",
"text": "I agree to the terms and conditions"
}
]
}) }}

### Checkboxes with all fieldset attributes

[Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/checkboxes/with-all-fieldset-attributes/preview)
Expand Down
3 changes: 2 additions & 1 deletion src/components/checkboxes/checkboxes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ examples:
- value: blue
text: Blue

- name: with single option set aria-describeby on input
- name: with single option set 'aria-describeby' on input
readme: false
data:
name: t-and-c
errorMessage:
Expand Down
2 changes: 1 addition & 1 deletion src/components/checkboxes/template.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ describe('Checkboxes', () => {

describe('single checkbox without a fieldset', () => {
it('adds aria-describe to input if there is an error', () => {
const $ = render('checkboxes', examples['with single option set aria-describeby on input'])
const $ = render('checkboxes', examples["with single option set 'aria-describeby' on input"])
const $input = $('input')
expect($input.attr('aria-describedby')).toMatch('t-and-c-error')
})
Expand Down

0 comments on commit 9cceaae

Please sign in to comment.