Skip to content

Conversation

@tombye
Copy link
Contributor

@tombye tombye commented Aug 29, 2023

Fix for a bug that causes the JAWS screen reader to announce all links in an email with the same URL.

This issue was reported in https://govuk.zendesk.com/agent/tickets/5415190.

Through a lot of testing, I found the issue appears in emails:

  1. with the 'Your logo' branding 1
  2. that have a certain combination of content (I haven't been able to find the exact combination but I do have emails which contain the bug)

The 'Your logo' branding HTML uses 2 tables cells to align the logo image and text (if present):

custom_branding_showing_cell_borders

We currently leave the table cell for the branding text empty if the branding doesn't have text. This seems to be causing the bug. Removing that cell, when empty, fixes it so these changes do that.

Quirks with the fix

max-width to constrain the logo image

These changes also include the addition of inline CSS setting max-width on the table cell containing the logo image, to stop the Outlook app on Android from stretching the logo to twice the size. Here's an example of that happening:

nhs_enlarged_logo

Note that we only apply max-width when there is no text. Setting it on the cell with the logo image makes it overlap the text in several email clients. I think this is because we set the cell for the text to width:100%. If the cell for the logo image also has an explicit width set, some email clients don't seem to have a table layout algorithm that can handle this so they overlap.

Keeping height on the tag

It probably seems strange to keep the height attribute on the tag but that is needed to keep the image working on Outlook on Windows.

How to review

These changes have been reviewed for visual problems in email clients, using our emailonacid tool and with the JAWS and NVDA screen readers with the assistivelabs tool.

These changes should be reviewed for whether they make sense or not as all email testing happens with 3rd party testing tools (see https://github.com/alphagov/notifications-manuals/wiki/Support-for-browsers,-email-clients-and-assistive-technologies#support-for-email-clients). If you want to see the bug, and fix, demo'ed with a screen reader, or to see the visual tests for email clients, Tom will be happy to do this.

Footnotes

  1. https://github.com/alphagov/notifications-manuals/wiki/Email-template-documentation#email-branding

For some reason the cell used to hold the branding
text causes an error with the JAWS screen reader
when empty (which it is when the 'only branding'
brand has no text).

In this state, and when the content of the email
has a certain form, JAWS announces all links in
the email the same.

This therefore removes that cell when it is empty.

It includes the addition of a max-width to stop
the Outlook app on Android from stretching the
logo to twice the size. It seems strange to keep
the height attribute on the <img> tag but that is
needed to keep the image working on Outlook on
Windows.

Also note that we only apply the max-width when
there is no text. Setting it on the cell with the
logo image makes it overlap the text in several
email clients.
Copy link
Contributor

@whpearson whpearson left a comment

Choose a reason for hiding this comment

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

Changes make sense, although the bug doesn't. I've seen the new variant work with the screen readers, so it gets the thumbs up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants