Fix hidden external link text warning so it can be read by screen readers #56
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Brief overview of changes
Updated the CSS for the hidden warning in
external_link()
.Why are these changes being made?
Honestly? I never tested it properly in the first place (copying in @rmbielby and @jen-machin as past reviewers for sight too).
I noticed something at a conference this week about the
display: none
CSS value, which actually hides content from screen readers and remembered I'd made the CSS for theexternal_link()
function on the assumption it only visually hid content but still gave that to screen readers to read out.As a result I've now gone back and tested it, realised my mistakes, and found a new suggested sr-only CSS class from WebAIM.
Detailed description of changes
I realised when testing this with a screen reader that links are automatically announced as a link, so having
Link. This link opens in a new tab. R Shiny.
felt pretty clunky! That example now reads asLink. R Shiny (opens in a new tab).
to screen readers, which mirrors how screen readers read the main visual version of the warning too.www
from .gitignore, as actually we do want to Git control any custom CSS like we have hereAdditional information for reviewers
Windows has narrator built in, NVDA also has a free download to use, these are probably the easiest screen reader options for testing this.
Issue ticket number/s and link
No related ticket as I raised the PR as soon as I realised.