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

Long, unbroken link text (such as email addresses) can break out of page container #2233

Closed
abbott567 opened this issue May 20, 2021 · 4 comments · Fixed by #5159
Closed
Labels
🐛 bug Something isn't working the way it should (including incorrect wording in documentation) layout typography

Comments

@abbott567
Copy link

abbott567 commented May 20, 2021

Summary

The standard wrapping on body content can create a scenario where long email addresses can cause a service to fail WCAG 2.1 - 1.4.10 Reflow.

Reflow states that content must not force horizontal scrolling in a viewport of 320px wide unless it's a map, a table, a game or something else where it is necessary. For regular content it needs to reflow and maintain vertical scrolling only.

If you provide an email address which does not contain regular breaking characters such as hyphens, then the email address refuses to break and forces the viewport to horizontal scroll.

By adding the CSS property: overflow-wrap:anywhere the issue is resolved.

Steps to reproduce the issue

  1. Add a long email address to some body content which does not contain any standard breaking characters. For example:
<a href="#" class="govuk-link">
  anExampleOfAReallyLongEmailAddress@WhichPushesTheContentOver320PixelsWide.com
</a>
  1. Reduce the viewport width to 320px wide and observe horizontal scrolling.

image

Environment (where applicable)

  • Operating system: OS X Catalina + Windows 10
  • Browser: Chrome (Mac), Chrome (Win), Edge, Safari
  • GOV.UK Frontend Version: 3.12.0
@abbott567 abbott567 added awaiting triage Needs triaging by team 🐛 bug Something isn't working the way it should (including incorrect wording in documentation) labels May 20, 2021
@abbott567
Copy link
Author

Worth pointing out the service this was observed on was a staff facing system, so the email address was probably longer than usual. It was chaining together team names and business areas using full stops. For example: `jonathan.macfarland@orangeteam.improvementprojects.department.gov.uk

@36degrees
Copy link
Contributor

I'm not sure there's an easy generic fix for this. Adding overflow-wrap:anywhere to the body (or applying it generally to paragraphs, links etc) causes issues wherever we're relying on intrinsic sizing for layout, for example in tables or the phase banner.

Screenshot 2021-06-03 at 15 05 12
Screenshot 2021-06-03 at 15 06 40

I think this is something that would need to be handled on a case by case basis, like we have for summary list.

@abbott567
Copy link
Author

Yeah, I guess even if it was available as a class so you could override it manually. Possibly like .govuk-!-force-wrap or something.

alex9smith pushed a commit to Crown-Commercial-Service/digitalmarketplace-visual-regression that referenced this issue Jun 21, 2021
On backstopjs 5.1 and above we were seeing test failures with very
minor rendering differences to the reference images, and also fonts
not always loading.

We are not the only people seeing these problems - see [[1]] and [[2]].
In those issues, the author of backstopjs suggests that this is
actually an issue with puppeteer, and another user suggests adding
these lines to `onReady.js` to force the engine to wait for the fonts
to load and ensure the window is always in the same place before taking
 a screenshot.

We already merged this in #68, however reverted it in #69 because we
thought it hadn't fixed the problems.

Some more research showed that the CSS problems with text overflow on
mobile are actually a separate bug with the GOV.UK Design System[[3]].

Therefore we can merge this again and it'll hopefully fix the problems
we can address and allow us to stay up to date with backstop.

[1]:garris/BackstopJS#1303
[2]:garris/BackstopJS#1318
[3]:alphagov/govuk-frontend#2233
@vanitabarrett vanitabarrett added accessibility 🕔 days and removed awaiting triage Needs triaging by team labels Sep 24, 2021
@querkmachine querkmachine changed the title Long email address links can break accessibility compliance Long, unbroken link text (such as email addresses) can break out of page container Jun 13, 2024
Copy link

Uh oh! @abbott567, the image you shared is missing helpful alt text. Check your issue body.

Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.

Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.

🤖 Beep boop! This comment was added automatically by github/accessibility-alt-text-bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working the way it should (including incorrect wording in documentation) layout typography
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants