-
Notifications
You must be signed in to change notification settings - Fork 0
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
Focus outline applied on click/touch of [tabindex="-1"] (Safari 14.1.1) #2
Comments
Actually, my assumption that
Therefore So the stylistic solution would be to use But the semantic solution would be to treat |
wpdtrt-anchorlinks requires the ID on the section container, as this determines which anchor link is bolded during scrolling. The tabindex is presumably there so that activating the anchor link moves the tab focus to the target so that subsequent tab presses are relative to the selected section.
However this doesn't mean that the anchor needs to link to (and move focus to) the same ID - this could be refactored so it links to a child element. Note that wpdtrt-gallery rebuilds the section elements when adding it's own markup |
Pages that use self-referencing heading links - possibly AKA 'bookmark links':https://css-tricks.com/hash-tag-links-padding/ Uses <h3>
<a href="#target" aria-hidden="true" class="aal_anchor" id="target">
<svg aria-hidden="true">
<path ... ></path>
</svg>
</a>
Heading text
</h3> I've emailed them about the tab order issue. https://github.com/dotherightthing/wpdtrt-plugin-boilerplate Github Markdown uses a similar system, except the anchor icons only appear on hover. However they are still in the tab order - and the icon does not appear on tab focus. <h2>
<a id="target" class="anchor" aria-hidden="true" href="#target">
<svg aria-hidden="true">
<path></path>
</svg>
</a>
Installation
</h2> I logged an issue on the GFM repo. https://www.bryanbraun.com/anchorjs/ Generates anchor icons with duplicate <h2 id="target">
Installation
<a class="anchorjs-link " aria-label="Anchor" data-anchorjs-icon="" href="#target" style="font: 1em / 1 anchorjs-icons; padding-left: 0.375em;"></a>
</h2> I logged an issue on the anchorjs repo. https://amberwilson.co.uk/blog/are-your-anchor-links-accessible/ Amber Wilson has put together a deep dive on appropriate solutions (December 14th, 2020). She suggested two options: (A) Amber Wilson's approach: <h2 id="introduction">Introduction</h2>
<a href="#introduction">
<span aria-hidden="true">#</span>
<span class="hidden">Section titled introduction</span>
</a> This approach adds verbosity to the screen reader's links list, as there will be multiple links beginning with "Section titled". (B) Barry Pollard's approach: <h2 id="ease-of-reading">
<a href="#ease-of-reading" class="anchor-link">
::before
Ease of reading
</a>
</h2> This approach has zero fluff. So long as the link is not (C) Lee Reamsnyder then tweaked this to support Safari Reader, which otherwise removes the linked headings: <h2 id="introduction">
<a href="#introduction">
<span>
Introduction
</span>
</a>
</h2> |
Once this is tested, opening an issue / submitting a PR on https://github.com/vyskoczilova/add-anchor-links will address CSS Tricks' implementation. |
There's also feature detection for |
…n, show the icon on the left and include the text in the link/anchor, shorten data attributes (#24, dotherightthing/wpdtrt-scss#2)
…n, show the icon on the left and include the text in the link/anchor, shorten data attributes (#24, dotherightthing/wpdtrt-scss#2)
From https://github.com/dotherightthing/wpdtrt-dbth/issues/228
Elements with
tabindex="-1"
should only be programmatically focusable.This outline is suppressed in the SCSS:
wpdtrt-scss/scss/_frontend.scss
Lines 14 to 32 in c3e5c66
But Safari overrides the compiled CSS by applying a new internal style:
This style was added in Changeset 250788 in webkit via Bug 202432 - focus pseudo class should match a shadow host whose shadow tree contains the focused element, via :focus-visible in WebKit - January 2021.
Safari appears to deem user focus of elements with
tabindex="-1"
to match the:focus
, and my:focus
rules are being overridden by Safari's:focus
replacement,:-webkit-direct-focus
:Whatever the reason, this issue is resolved in the latest Safari Technology Preview (Release 125) which adds support for
:focus-visible
(Develop > Experimental Features > :focus-visible pseudo-class).For background and more information, see https://blogs.igalia.com/mrego/2021/06/07/focus-visible-in-webkit-may-2021/
The text was updated successfully, but these errors were encountered: