nhsuk-frontend
nhsuk-frontend copied to clipboard
Use paragraphs for error messages
Description
Fixes #1029.
I'm unsure if this should be considered a breaking change or not - might be worth a discussion.
Visually there should be no difference.
| Before | After |
|---|---|
| Video with span | Video with paragraph |
Checklist
- [ ] Tested against our testing policy (Resolution, Browser & Accessibility)
- [ ] Follows our coding standards and style guide
- [x] CHANGELOG entry
Had a quick test of this and I don't find any difference in how VoiceOver or NVDA read the error message.
VoiceOver reads error separately and NVDA reads the whole line as one, regardless of span or p.
@anandamaryon1 your first example shows a visual <p> in the heading - is that a bug or something you added to tell them apart? If the later, how do they compare to GOV.UK's error messages?
@edwardhorsford @anandamaryon1 testing by GDS back in 2021 didn't seem to suggest there was any difference in screen reader treatment either? https://github.com/alphagov/govuk-frontend/issues/2083#issuecomment-979874842
@anandamaryon1 your first example shows a visual
<p>in the heading - is that a bug or something you added to tell them apart? If the later, how do they compare to GOV.UK's error messages?
Ah yes, that was just so that I could tell them apart.
I can have a look at GOV.UK's, I didn't check theirs.
Apologies this got left in limbo (for exactly a year!) @edwardhorsford…
Given that this will align us with GOV, shall we go ahead and merge this? Any reason not to @colinrotherham?
Ah perfect, just needs bringing back up to date
We've put https://github.com/nhsuk/nhsuk-frontend/issues/1029 against the v11.0.0 milestone currently
Just need to check if moving from <span> to <p> is 100% compatible (i.e. optional for non-Nunjucks libraries) then it can go in as a non-breaking change under v10.1.0 instead