<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Christina Adams</title>
    <description>The latest articles on DEV Community by Christina Adams (@offsetchris).</description>
    <link>https://dev.to/offsetchris</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F764624%2F9e8b1bf2-0589-4581-8f1c-7e8cd371767f.jpg</url>
      <title>DEV Community: Christina Adams</title>
      <link>https://dev.to/offsetchris</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/offsetchris"/>
    <language>en</language>
    <item>
      <title>The destructive side of ARIA HTML enhancements</title>
      <dc:creator>Christina Adams</dc:creator>
      <pubDate>Tue, 04 Oct 2022 16:42:55 +0000</pubDate>
      <link>https://dev.to/offsetchris/the-destructive-side-of-aria-html-enhancements-5f85</link>
      <guid>https://dev.to/offsetchris/the-destructive-side-of-aria-html-enhancements-5f85</guid>
      <description>&lt;h2&gt;
  
  
  ARIA == Accessible Rich Internet Applications
&lt;/h2&gt;

&lt;p&gt;This code system was created to enhance the user experience for assistive technology users and add semantics where HTML is lacking. But it can also completely destroy the user experience if not implemented properly. Let me give you two examples.&lt;/p&gt;

&lt;h2&gt;
  
  
  aria-label
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;aria-label&lt;/code&gt; attribute is (in my opinion) the most used aria technique. It is easy to understand and doesn't require additional markup changes. However, the value of the aria-label attribute &lt;strong&gt;completely destroys&lt;/strong&gt; any native text within the element that would provide an accessible name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;a href="http://twitter.com/offsetchris" 
   target="_blank" 
   aria-label="Opens in a new window"&amp;gt;
  Follow me on Twitter
&amp;lt;/a&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example what is the link's name? It depends on the audience.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Users referencing the visual interface: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Follow me on Twitter"&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Users accessing with assistive technology: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Opens in a new window"&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Two completely different experiences with different user expectations. The developer had the best intentions to make a better user experience for assistive technology users by adding &lt;em&gt;"Opens in a new window"&lt;/em&gt; to describe the behavior of the link opening a new tab or window when activated. Except now the native name of the link has been &lt;strong&gt;overwritten&lt;/strong&gt; by aria-label and some users have no reference to where the link will take them.&lt;/p&gt;

&lt;p&gt;This same destructive nature also applies to &lt;code&gt;aria-labelledby&lt;/code&gt; with the same results.&lt;/p&gt;

&lt;h2&gt;
  
  
  Authoring practices copy paste
&lt;/h2&gt;

&lt;p&gt;ARIA gives us nothing for free. It is the developer's responsibility to &lt;strong&gt;fully implement&lt;/strong&gt; a recommended widget or pattern. If the developer pastes in some of the HTML that is referenced but fails to add keyboard access scripting or ignores required child roles in a complex widget the pattern fails and often &lt;strong&gt;prohibits&lt;/strong&gt; users from accessing the widget entirely.&lt;/p&gt;

&lt;p&gt;Take the &lt;a href="https://www.w3.org/WAI/ARIA/apg/example-index/tabs/tabs-manual.html"&gt;Tab Panel example&lt;/a&gt; from the &lt;a href="https://www.w3.org/WAI/ARIA/apg/patterns/"&gt;ARIA Authoring Practices Guide&lt;/a&gt; document. If the developer scrolls down, finds the HTML for the example, pastes it into their system and never reads any further in the requirements what happens? Here is a sample of this pattern showing the clickable tab element code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div role="tablist"
       aria-labelledby="tablist-1"
       class="manual"&amp;gt;
    &amp;lt;button id="tab-1"
            type="button"
            role="tab"
            aria-selected="true"
            aria-controls="tabpanel-1"&amp;gt;
      &amp;lt;span class="focus"&amp;gt;
        Maria Ahlefeldt
      &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;
    &amp;lt;button id="tab-2"
            type="button"
            role="tab"
            aria-selected="false"
            aria-controls="tabpanel-2"
            tabindex="-1"&amp;gt;
      &amp;lt;span class="focus"&amp;gt;
        Carl Andersen
      &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;
    &amp;lt;button id="tab-3"
            type="button"
            role="tab"
            aria-selected="false"
            aria-controls="tabpanel-3"
            tabindex="-1"&amp;gt;
      &amp;lt;span class="focus"&amp;gt;
        Ida da Fonseca
      &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;
    &amp;lt;button id="tab-4"
            type="button"
            role="tab"
            aria-selected="false"
            aria-controls="tabpanel-4"
            tabindex="-1"&amp;gt;
      &amp;lt;span class="focus"&amp;gt;
        Peter Lange-Müller
      &amp;lt;/span&amp;gt;
    &amp;lt;/button&amp;gt;
  &amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The tabs are coded as buttons with a more semantic role of &lt;em&gt;tab&lt;/em&gt;. But notice the &lt;code&gt;tabindex="-1"&lt;/code&gt; on the last three tabs? If the recommended keyboard access to these tabs is not implemented as the Authoring Practices document describes the user will be able to use their TAB key on the keyboard to access the first tab but will never be able to access the second and third tab using keyboard alone. Not completing the ARIA pattern has withheld content from a specific user group, destroying the user experience (and likely trust) of any user trying to fully access your site. &lt;/p&gt;

&lt;h2&gt;
  
  
  Use with care
&lt;/h2&gt;

&lt;p&gt;ARIA is great! But you need to do it right and implement it with care because it can make a site substantially worse or even unusable if done improperly.&lt;/p&gt;




&lt;p&gt;Header image description: The Destructive Side of ARIA HTML Enhancements with a emoji thumb down over a dev panel showing aria-label overriding a native HTML name in a bad way. &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>html</category>
      <category>a11y</category>
    </item>
  </channel>
</rss>
