SlideShare a Scribd company logo
1 of 59
Download to read offline
Accessible

Button

Dropdown
Creating an
Introduction
My main role in recent times is to
work on the UX/UI and front-end
development of Pattern Libraries
for web applications.
However, I also work in the
Accessibility space. My focus in this
area is helping developers build
accessible web components for
complex Web apps.
One web component that can
present accessibility issues is the
button dropdown.
A button dropdown is where a
button is used to trigger the display
of contextual menus - such as a list
of links.
A diagram showing a button “Weyland Industries” with no dropdown displayed
A diagram showing a button “Weyland Industries” with the dropdown displayed below. 

The dropdown displays three options: “Weyland Industries”, “Stark Industries” and “Cyberdyne Systems”
We’re going to look at a range of
possible checkpoints that could
help make button dropdowns more
accessible.
We’ll use an imaginary example of a
button dropdown that allows users
to switch their current
organisation.
A diagram showing a button “Weyland Industries” with the dropdown displayed below. 

The dropdown displays three options: “Weyland Industries”, “Stark Industries” and “Cyberdyne Systems”
1.
Semantics
As the name suggests, the ideal
element that should be used for the
trigger, is the <button> element.
<button  type="button">  
    Weyland  Industries  
</button>
The fundamental difference between
buttons and links is that buttons
should do something (cause
something to happen), and links
should go somewhere (go to a
different location).
The markup for the dropdown
depends on the role of the items
inside. If the items are a list of links,
then an unordered list of links is
ideal.
<ul>  
    <li><a  href="#">Weyland  Industries</a></li>  
    <li><a  href="#">Stark  Industries</a></li>  
    <li><a  href="#">Cyberdyne  Systems</a></li>  
</ul>
2.
Getting to the button
Keyboard-only users should be
able to TAB to the button, which
then receives focus.
3.
Announcing the button
The aria-­‐label attribute can be
used to announce the button value
along with any additional
information to screen reader users.
For modern screen readers, the
aria-­‐label value will be
announced instead of the button
value.
<button  
    type="button"  
aria-­‐label="Current  company:  Weyland  Industries.  Use  
the  dropdown  menu  to  switch  companies"  
>  
    Weyland  Industries  
</button>
The aria-­‐haspopup="true"
attribute can be used to announce
the button as a “popup button” to
screen readers.
This is important, as it tells screen
reader users that it is a different
type of button - not a normal
button associated with submitting a
form etc.
<button  
    type="button"  
aria-­‐label="Current  company:  Weyland  Industries.  Use  
the  dropdown  menu  to  switch  companies"  
    aria-­‐haspopup="true"  
>  
    Weyland  Industries  
</button>
The aria-­‐expanded="false"
attribute can be used to announce
the current state of the popup
button to screen readers - i.e the
dropdown below the button is not
currently expanded.
The "false" value would need to
be changed to "true" via
JavaScript as soon as the user
triggers the button.
<button  
    type="button"  
aria-­‐label="Current  company:  Weyland  Industries.  Use  
the  dropdown  menu  to  switch  companies"  
    aria-­‐haspopup="true"  
    aria-­‐expanded="false"  
>  
    Weyland  Industries  
</button>
Alternatively, the aria-­‐
expanded="true" attribute could
be injected via JavaScript only
when the button is triggered -
which would reduce the amount of
information being announced.
4.
Triggering the button
For keyboard-only users, ENTER or
SPACEBAR strokes should trigger
the dropdown to appear.
5.
After the button is
triggered
If the aria-­‐expanded="false"
attribute is present in the default
button state, it should be changed
to aria-­‐expanded="true" via
JavaScript.
If the aria-­‐expanded="false"
attribute is not present in the
default button state, the aria-­‐
expanded="true" should be
injected via JavaScript.
<button  
    type="button"  
aria-­‐label="Current  company:  Weyland  Industries.  Use  
the  dropdown  menu  to  switch  companies"  
    aria-­‐haspopup="true"  
    aria-­‐expanded="true"  
>  
    Weyland  Industries  
</button>
Focus should immediately shift to
the <ul> element and the dropdown
should become visible.
This is something that most button
dropdown solutions do not solve
elegantly. In many cases, users
trigger the button but the focus
does not shift at all.
Users are either given silence after
they trigger the button, or the button
information is repeated again. This
can cause confusion for users who
cannot see that the dropdown has
been triggered, but nothing has
been announced.
The <ul> element could be given an
aria-­‐label value, which means
that when it receives focus, it’s
purpose is announced.
<ul  aria-­‐label="Switch  Companies">  
    <li><a  href="#">Weyland  Industries</a></li>  
    <li><a  href="#">Stark  Industries</a></li>  
    <li><a  href="#">Cyberdyne  Systems</a></li>  
</ul>  
A side note:

If the current organisation exists in
the long list of dropdown items, it
may be a good ideal to flag this item
as the current organisation for
screen reader users.
This can be achieved with a range
of different methods, including
providing additional information
that is hidden off-screen.
<ul  aria-­‐label="Switch  Companies">  
    <li>  
        <a  href="#">  
            <span  class="hidden">Current  company:  </span>  
            Weyland  Industries  
        </a>  
    </li>  
    <li><a  href="#">Stark  Industries</a></li>  
    <li><a  href="#">Cyberdyne  Systems</a></li>  
</ul>
8.
To escape the dropdown
For keyboard-only users, the ESC
keystroke should close the
dropdown and return focus to the
button.
7.
To navigate through
items within the
dropdown
When focus has shifted to the <ul>
element, keyboard-only users
should be able to use TAB, SHIFT
TAB, UP ARROW or DOWN
ARROW to move forwards or
backwards through the list items.
When users reach the start or end of
the list, UP ARROW and DOWN
ARROW keystrokes should then
have not have any effect.
8.
Selecting a dropdown
item
Keyboard-only users should be able
to select a dropdown menu item
using ENTER and possibly the
SPACEBAR keystrokes.
9.
To leave the dropdown
Keyboard-only users should be able
to TAB forward through the
dropdown items and then on to
other focusable items outside the
dropdown.
As soon focus leave the last
dropdown item, the dropdown
should disappear.
Users should be able to SHIFT
TAB backwards through the
dropdown items and back to the
button.
The dropdown should remain open
when the button receives focus.
(Users can close the dropdown by
triggering the button again).
Conclusion
So, that’s it. A few simple pointers
to help make button dropdowns
more accessible.

Thanks for listening!
Russ Weakley
Max Design
Site: maxdesign.com.au
Twitter: twitter.com/russmaxdesign
Slideshare: slideshare.net/maxdesign
Linkedin: linkedin.com/in/russweakley

More Related Content

What's hot

The power of creative collaboration
The power of creative collaborationThe power of creative collaboration
The power of creative collaborationTable19
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with DataSeth Familian
 
Fjord Trends 2020: Emerging Trends in Business | Accenture
Fjord Trends 2020: Emerging Trends in Business | AccentureFjord Trends 2020: Emerging Trends in Business | Accenture
Fjord Trends 2020: Emerging Trends in Business | Accentureaccenture
 
Mobile First SEO at #WCEU
Mobile First SEO at #WCEU Mobile First SEO at #WCEU
Mobile First SEO at #WCEU Aleyda Solís
 
Back of the Napkin / Blah-Blah-Blah Seminar
Back of the Napkin / Blah-Blah-Blah SeminarBack of the Napkin / Blah-Blah-Blah Seminar
Back of the Napkin / Blah-Blah-Blah SeminarDan Roam
 
SXSW 2016: The Need To Knows
SXSW 2016: The Need To KnowsSXSW 2016: The Need To Knows
SXSW 2016: The Need To KnowsOgilvy Consulting
 
UX Lesson 6: Visual Hierarchy
UX Lesson 6: Visual HierarchyUX Lesson 6: Visual Hierarchy
UX Lesson 6: Visual HierarchyJoan Lumanauw
 
Top 10 Email Tips for Financial Advisors
Top 10 Email Tips for Financial AdvisorsTop 10 Email Tips for Financial Advisors
Top 10 Email Tips for Financial AdvisorsFinworx
 
The Hard Truths of Entrepreneurship
The Hard Truths of EntrepreneurshipThe Hard Truths of Entrepreneurship
The Hard Truths of EntrepreneurshipRand Fishkin
 
Quick Look - Auto Insurance UX Benchmark Study | UserZoom
Quick Look - Auto Insurance UX Benchmark Study | UserZoomQuick Look - Auto Insurance UX Benchmark Study | UserZoom
Quick Look - Auto Insurance UX Benchmark Study | UserZoomUserZoom
 
Inbound PR - Building Links with Less Cold Outreach
Inbound PR - Building Links with Less Cold OutreachInbound PR - Building Links with Less Cold Outreach
Inbound PR - Building Links with Less Cold OutreachStacey MacNaught
 
25 Need-to-Know Marketing Stats
25 Need-to-Know Marketing Stats25 Need-to-Know Marketing Stats
25 Need-to-Know Marketing Statscontently
 
The 8-Step eCommerce Framework to Elevate Your SEO Game at #WTSFest 2020
The 8-Step eCommerce Framework to Elevate Your SEO Game at #WTSFest 2020The 8-Step eCommerce Framework to Elevate Your SEO Game at #WTSFest 2020
The 8-Step eCommerce Framework to Elevate Your SEO Game at #WTSFest 2020Kristina Azarenko
 
Understanding Web Accessibility
Understanding Web AccessibilityUnderstanding Web Accessibility
Understanding Web AccessibilityAndrea Dubravsky
 
[Infographic] How will Internet of Things (IoT) change the world as we know it?
[Infographic] How will Internet of Things (IoT) change the world as we know it?[Infographic] How will Internet of Things (IoT) change the world as we know it?
[Infographic] How will Internet of Things (IoT) change the world as we know it?InterQuest Group
 
UX lesson 3: Usability First
UX lesson 3: Usability FirstUX lesson 3: Usability First
UX lesson 3: Usability FirstJoan Lumanauw
 
The Number One Mistake Everybody Makes on Twitter
The Number One Mistake Everybody Makes on TwitterThe Number One Mistake Everybody Makes on Twitter
The Number One Mistake Everybody Makes on TwitterGary Vaynerchuk
 
Dynamic Rendering - is this really an SEO silver bullet? SMX WEST
Dynamic Rendering - is this really an SEO silver bullet? SMX WESTDynamic Rendering - is this really an SEO silver bullet? SMX WEST
Dynamic Rendering - is this really an SEO silver bullet? SMX WESTOnely
 

What's hot (20)

The power of creative collaboration
The power of creative collaborationThe power of creative collaboration
The power of creative collaboration
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with Data
 
Fjord Trends 2020: Emerging Trends in Business | Accenture
Fjord Trends 2020: Emerging Trends in Business | AccentureFjord Trends 2020: Emerging Trends in Business | Accenture
Fjord Trends 2020: Emerging Trends in Business | Accenture
 
Mobile First SEO at #WCEU
Mobile First SEO at #WCEU Mobile First SEO at #WCEU
Mobile First SEO at #WCEU
 
Back of the Napkin / Blah-Blah-Blah Seminar
Back of the Napkin / Blah-Blah-Blah SeminarBack of the Napkin / Blah-Blah-Blah Seminar
Back of the Napkin / Blah-Blah-Blah Seminar
 
SXSW 2016: The Need To Knows
SXSW 2016: The Need To KnowsSXSW 2016: The Need To Knows
SXSW 2016: The Need To Knows
 
UX Lesson 6: Visual Hierarchy
UX Lesson 6: Visual HierarchyUX Lesson 6: Visual Hierarchy
UX Lesson 6: Visual Hierarchy
 
Top 10 Email Tips for Financial Advisors
Top 10 Email Tips for Financial AdvisorsTop 10 Email Tips for Financial Advisors
Top 10 Email Tips for Financial Advisors
 
The Hard Truths of Entrepreneurship
The Hard Truths of EntrepreneurshipThe Hard Truths of Entrepreneurship
The Hard Truths of Entrepreneurship
 
Real estate website presentation
Real estate website presentationReal estate website presentation
Real estate website presentation
 
Quick Look - Auto Insurance UX Benchmark Study | UserZoom
Quick Look - Auto Insurance UX Benchmark Study | UserZoomQuick Look - Auto Insurance UX Benchmark Study | UserZoom
Quick Look - Auto Insurance UX Benchmark Study | UserZoom
 
Inbound PR - Building Links with Less Cold Outreach
Inbound PR - Building Links with Less Cold OutreachInbound PR - Building Links with Less Cold Outreach
Inbound PR - Building Links with Less Cold Outreach
 
25 Need-to-Know Marketing Stats
25 Need-to-Know Marketing Stats25 Need-to-Know Marketing Stats
25 Need-to-Know Marketing Stats
 
The 8-Step eCommerce Framework to Elevate Your SEO Game at #WTSFest 2020
The 8-Step eCommerce Framework to Elevate Your SEO Game at #WTSFest 2020The 8-Step eCommerce Framework to Elevate Your SEO Game at #WTSFest 2020
The 8-Step eCommerce Framework to Elevate Your SEO Game at #WTSFest 2020
 
Understanding Web Accessibility
Understanding Web AccessibilityUnderstanding Web Accessibility
Understanding Web Accessibility
 
[Infographic] How will Internet of Things (IoT) change the world as we know it?
[Infographic] How will Internet of Things (IoT) change the world as we know it?[Infographic] How will Internet of Things (IoT) change the world as we know it?
[Infographic] How will Internet of Things (IoT) change the world as we know it?
 
Design Your Career 2018
Design Your Career 2018Design Your Career 2018
Design Your Career 2018
 
UX lesson 3: Usability First
UX lesson 3: Usability FirstUX lesson 3: Usability First
UX lesson 3: Usability First
 
The Number One Mistake Everybody Makes on Twitter
The Number One Mistake Everybody Makes on TwitterThe Number One Mistake Everybody Makes on Twitter
The Number One Mistake Everybody Makes on Twitter
 
Dynamic Rendering - is this really an SEO silver bullet? SMX WEST
Dynamic Rendering - is this really an SEO silver bullet? SMX WESTDynamic Rendering - is this really an SEO silver bullet? SMX WEST
Dynamic Rendering - is this really an SEO silver bullet? SMX WEST
 

Similar to Creating an Accessible button dropdown

Creating accessible modals and autocompletes
Creating accessible modals and autocompletesCreating accessible modals and autocompletes
Creating accessible modals and autocompletesRuss Weakley
 
Front End Frameworks - are they accessible
Front End Frameworks - are they accessibleFront End Frameworks - are they accessible
Front End Frameworks - are they accessibleRuss Weakley
 
Ccure 9000 Admin user's manual
Ccure 9000 Admin user's manualCcure 9000 Admin user's manual
Ccure 9000 Admin user's manualBill Kelly
 
Building Accessible Web Components
Building Accessible Web ComponentsBuilding Accessible Web Components
Building Accessible Web ComponentsRuss Weakley
 
Netsupport
NetsupportNetsupport
Netsupportvpcamor
 
Building accessible web components without tears
Building accessible web components without tearsBuilding accessible web components without tears
Building accessible web components without tearsRuss Weakley
 
Alv report-tutorial-www.sapexpert.co .uk-
Alv report-tutorial-www.sapexpert.co .uk-Alv report-tutorial-www.sapexpert.co .uk-
Alv report-tutorial-www.sapexpert.co .uk-Faina Fridman
 
CSS Disable Button - How to Disable Buttons Using CSS - Blogs
CSS Disable Button - How to Disable Buttons Using CSS - BlogsCSS Disable Button - How to Disable Buttons Using CSS - Blogs
CSS Disable Button - How to Disable Buttons Using CSS - BlogsRonDosh
 
Sap - Initiation Manual
Sap - Initiation ManualSap - Initiation Manual
Sap - Initiation ManualKumar M.
 
URL Hacking 101: An Easy Way to Streamline Processes in Salesforce
URL Hacking 101: An Easy Way to Streamline Processes in Salesforce URL Hacking 101: An Easy Way to Streamline Processes in Salesforce
URL Hacking 101: An Easy Way to Streamline Processes in Salesforce Configero
 
Google calendar integration in iOS app
Google calendar integration in iOS appGoogle calendar integration in iOS app
Google calendar integration in iOS appKetan Raval
 
Ccure 9000 Monitoring Station User's Manual
Ccure 9000 Monitoring Station User's ManualCcure 9000 Monitoring Station User's Manual
Ccure 9000 Monitoring Station User's ManualBill Kelly
 
Creating a Simple, Accessible On/Off Switch
Creating a Simple, Accessible On/Off SwitchCreating a Simple, Accessible On/Off Switch
Creating a Simple, Accessible On/Off SwitchRuss Weakley
 
Cordova training : Day 6 - UI development using Framework7
Cordova training : Day 6 - UI development using Framework7Cordova training : Day 6 - UI development using Framework7
Cordova training : Day 6 - UI development using Framework7Binu Paul
 
Web accessibility - WAI-ARIA a small introduction
Web accessibility - WAI-ARIA a small introductionWeb accessibility - WAI-ARIA a small introduction
Web accessibility - WAI-ARIA a small introductionGeoffroy Baylaender
 
Magento 2 Advance Shop By Brand Extension
Magento 2 Advance Shop By Brand ExtensionMagento 2 Advance Shop By Brand Extension
Magento 2 Advance Shop By Brand ExtensionAppJetty
 
Getting started with workflow
Getting started with workflowGetting started with workflow
Getting started with workflowseenu126
 

Similar to Creating an Accessible button dropdown (20)

Creating accessible modals and autocompletes
Creating accessible modals and autocompletesCreating accessible modals and autocompletes
Creating accessible modals and autocompletes
 
2 front panel
2  front panel2  front panel
2 front panel
 
Front End Frameworks - are they accessible
Front End Frameworks - are they accessibleFront End Frameworks - are they accessible
Front End Frameworks - are they accessible
 
Ccure 9000 Admin user's manual
Ccure 9000 Admin user's manualCcure 9000 Admin user's manual
Ccure 9000 Admin user's manual
 
Building Accessible Web Components
Building Accessible Web ComponentsBuilding Accessible Web Components
Building Accessible Web Components
 
Netsupport
NetsupportNetsupport
Netsupport
 
Building accessible web components without tears
Building accessible web components without tearsBuilding accessible web components without tears
Building accessible web components without tears
 
Alv report-tutorial-www.sapexpert.co .uk-
Alv report-tutorial-www.sapexpert.co .uk-Alv report-tutorial-www.sapexpert.co .uk-
Alv report-tutorial-www.sapexpert.co .uk-
 
CSS Disable Button - How to Disable Buttons Using CSS - Blogs
CSS Disable Button - How to Disable Buttons Using CSS - BlogsCSS Disable Button - How to Disable Buttons Using CSS - Blogs
CSS Disable Button - How to Disable Buttons Using CSS - Blogs
 
Sap - Initiation Manual
Sap - Initiation ManualSap - Initiation Manual
Sap - Initiation Manual
 
URL Hacking 101: An Easy Way to Streamline Processes in Salesforce
URL Hacking 101: An Easy Way to Streamline Processes in Salesforce URL Hacking 101: An Easy Way to Streamline Processes in Salesforce
URL Hacking 101: An Easy Way to Streamline Processes in Salesforce
 
Google calendar integration in iOS app
Google calendar integration in iOS appGoogle calendar integration in iOS app
Google calendar integration in iOS app
 
Ccure 9000 Monitoring Station User's Manual
Ccure 9000 Monitoring Station User's ManualCcure 9000 Monitoring Station User's Manual
Ccure 9000 Monitoring Station User's Manual
 
Creating a Simple, Accessible On/Off Switch
Creating a Simple, Accessible On/Off SwitchCreating a Simple, Accessible On/Off Switch
Creating a Simple, Accessible On/Off Switch
 
Accessible code-patterns
Accessible code-patternsAccessible code-patterns
Accessible code-patterns
 
Cordova training : Day 6 - UI development using Framework7
Cordova training : Day 6 - UI development using Framework7Cordova training : Day 6 - UI development using Framework7
Cordova training : Day 6 - UI development using Framework7
 
(Manual spss)
(Manual spss)(Manual spss)
(Manual spss)
 
Web accessibility - WAI-ARIA a small introduction
Web accessibility - WAI-ARIA a small introductionWeb accessibility - WAI-ARIA a small introduction
Web accessibility - WAI-ARIA a small introduction
 
Magento 2 Advance Shop By Brand Extension
Magento 2 Advance Shop By Brand ExtensionMagento 2 Advance Shop By Brand Extension
Magento 2 Advance Shop By Brand Extension
 
Getting started with workflow
Getting started with workflowGetting started with workflow
Getting started with workflow
 

More from Russ Weakley

Accessible chat windows
Accessible chat windowsAccessible chat windows
Accessible chat windowsRuss Weakley
 
Accessible names & descriptions
Accessible names & descriptionsAccessible names & descriptions
Accessible names & descriptionsRuss Weakley
 
A deep dive into accessible names
A deep dive into accessible namesA deep dive into accessible names
A deep dive into accessible namesRuss Weakley
 
What are accessible names and why should you care?
What are accessible names and why should you care?What are accessible names and why should you care?
What are accessible names and why should you care?Russ Weakley
 
How to build accessible UI components
How to build accessible UI componentsHow to build accessible UI components
How to build accessible UI componentsRuss Weakley
 
What is WCAG 2 and why should we care?
What is WCAG 2 and why should we care?What is WCAG 2 and why should we care?
What is WCAG 2 and why should we care?Russ Weakley
 
Building an accessible progressive loader
Building an accessible progressive loaderBuilding an accessible progressive loader
Building an accessible progressive loaderRuss Weakley
 
Accessibility in Design systems - the pain and glory
Accessibility in Design systems - the pain and gloryAccessibility in Design systems - the pain and glory
Accessibility in Design systems - the pain and gloryRuss Weakley
 
Accessible Inline errors messages
Accessible Inline errors messagesAccessible Inline errors messages
Accessible Inline errors messagesRuss Weakley
 
Accessible Form Hints and Errors
Accessible Form Hints and ErrorsAccessible Form Hints and Errors
Accessible Form Hints and ErrorsRuss Weakley
 
What is accessibility?
What is accessibility?What is accessibility?
What is accessibility?Russ Weakley
 
Accessibility in Pattern Libraries
Accessibility in Pattern LibrariesAccessibility in Pattern Libraries
Accessibility in Pattern LibrariesRuss Weakley
 
Accessibility in pattern libraries
Accessibility in pattern librariesAccessibility in pattern libraries
Accessibility in pattern librariesRuss Weakley
 
Building an accessible auto-complete - #ID24
Building an accessible auto-complete - #ID24Building an accessible auto-complete - #ID24
Building an accessible auto-complete - #ID24Russ Weakley
 
Building an accessible auto-complete
Building an accessible auto-completeBuilding an accessible auto-complete
Building an accessible auto-completeRuss Weakley
 
Creating Acessible floating labels
Creating Acessible floating labelsCreating Acessible floating labels
Creating Acessible floating labelsRuss Weakley
 
Accessible custom radio buttons and checkboxes
Accessible custom radio buttons and checkboxesAccessible custom radio buttons and checkboxes
Accessible custom radio buttons and checkboxesRuss Weakley
 
Deep Dive into Line-Height
Deep Dive into Line-HeightDeep Dive into Line-Height
Deep Dive into Line-HeightRuss Weakley
 
Understanding the mysteries of the CSS property value syntax
Understanding the mysteries of the CSS property value syntaxUnderstanding the mysteries of the CSS property value syntax
Understanding the mysteries of the CSS property value syntaxRuss Weakley
 
aria-live: the good, the bad and the ugly
aria-live: the good, the bad and the uglyaria-live: the good, the bad and the ugly
aria-live: the good, the bad and the uglyRuss Weakley
 

More from Russ Weakley (20)

Accessible chat windows
Accessible chat windowsAccessible chat windows
Accessible chat windows
 
Accessible names & descriptions
Accessible names & descriptionsAccessible names & descriptions
Accessible names & descriptions
 
A deep dive into accessible names
A deep dive into accessible namesA deep dive into accessible names
A deep dive into accessible names
 
What are accessible names and why should you care?
What are accessible names and why should you care?What are accessible names and why should you care?
What are accessible names and why should you care?
 
How to build accessible UI components
How to build accessible UI componentsHow to build accessible UI components
How to build accessible UI components
 
What is WCAG 2 and why should we care?
What is WCAG 2 and why should we care?What is WCAG 2 and why should we care?
What is WCAG 2 and why should we care?
 
Building an accessible progressive loader
Building an accessible progressive loaderBuilding an accessible progressive loader
Building an accessible progressive loader
 
Accessibility in Design systems - the pain and glory
Accessibility in Design systems - the pain and gloryAccessibility in Design systems - the pain and glory
Accessibility in Design systems - the pain and glory
 
Accessible Inline errors messages
Accessible Inline errors messagesAccessible Inline errors messages
Accessible Inline errors messages
 
Accessible Form Hints and Errors
Accessible Form Hints and ErrorsAccessible Form Hints and Errors
Accessible Form Hints and Errors
 
What is accessibility?
What is accessibility?What is accessibility?
What is accessibility?
 
Accessibility in Pattern Libraries
Accessibility in Pattern LibrariesAccessibility in Pattern Libraries
Accessibility in Pattern Libraries
 
Accessibility in pattern libraries
Accessibility in pattern librariesAccessibility in pattern libraries
Accessibility in pattern libraries
 
Building an accessible auto-complete - #ID24
Building an accessible auto-complete - #ID24Building an accessible auto-complete - #ID24
Building an accessible auto-complete - #ID24
 
Building an accessible auto-complete
Building an accessible auto-completeBuilding an accessible auto-complete
Building an accessible auto-complete
 
Creating Acessible floating labels
Creating Acessible floating labelsCreating Acessible floating labels
Creating Acessible floating labels
 
Accessible custom radio buttons and checkboxes
Accessible custom radio buttons and checkboxesAccessible custom radio buttons and checkboxes
Accessible custom radio buttons and checkboxes
 
Deep Dive into Line-Height
Deep Dive into Line-HeightDeep Dive into Line-Height
Deep Dive into Line-Height
 
Understanding the mysteries of the CSS property value syntax
Understanding the mysteries of the CSS property value syntaxUnderstanding the mysteries of the CSS property value syntax
Understanding the mysteries of the CSS property value syntax
 
aria-live: the good, the bad and the ugly
aria-live: the good, the bad and the uglyaria-live: the good, the bad and the ugly
aria-live: the good, the bad and the ugly
 

Recently uploaded

Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 

Recently uploaded (20)

Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 

Creating an Accessible button dropdown

  • 3. My main role in recent times is to work on the UX/UI and front-end development of Pattern Libraries for web applications.
  • 4. However, I also work in the Accessibility space. My focus in this area is helping developers build accessible web components for complex Web apps.
  • 5. One web component that can present accessibility issues is the button dropdown.
  • 6. A button dropdown is where a button is used to trigger the display of contextual menus - such as a list of links.
  • 7. A diagram showing a button “Weyland Industries” with no dropdown displayed
  • 8. A diagram showing a button “Weyland Industries” with the dropdown displayed below. The dropdown displays three options: “Weyland Industries”, “Stark Industries” and “Cyberdyne Systems”
  • 9. We’re going to look at a range of possible checkpoints that could help make button dropdowns more accessible.
  • 10. We’ll use an imaginary example of a button dropdown that allows users to switch their current organisation.
  • 11. A diagram showing a button “Weyland Industries” with the dropdown displayed below. The dropdown displays three options: “Weyland Industries”, “Stark Industries” and “Cyberdyne Systems”
  • 13. As the name suggests, the ideal element that should be used for the trigger, is the <button> element.
  • 14. <button  type="button">      Weyland  Industries   </button>
  • 15. The fundamental difference between buttons and links is that buttons should do something (cause something to happen), and links should go somewhere (go to a different location).
  • 16. The markup for the dropdown depends on the role of the items inside. If the items are a list of links, then an unordered list of links is ideal.
  • 17. <ul>      <li><a  href="#">Weyland  Industries</a></li>      <li><a  href="#">Stark  Industries</a></li>      <li><a  href="#">Cyberdyne  Systems</a></li>   </ul>
  • 19. Keyboard-only users should be able to TAB to the button, which then receives focus.
  • 21. The aria-­‐label attribute can be used to announce the button value along with any additional information to screen reader users.
  • 22. For modern screen readers, the aria-­‐label value will be announced instead of the button value.
  • 23. <button      type="button"   aria-­‐label="Current  company:  Weyland  Industries.  Use   the  dropdown  menu  to  switch  companies"   >      Weyland  Industries   </button>
  • 24. The aria-­‐haspopup="true" attribute can be used to announce the button as a “popup button” to screen readers.
  • 25. This is important, as it tells screen reader users that it is a different type of button - not a normal button associated with submitting a form etc.
  • 26. <button      type="button"   aria-­‐label="Current  company:  Weyland  Industries.  Use   the  dropdown  menu  to  switch  companies"      aria-­‐haspopup="true"   >      Weyland  Industries   </button>
  • 27. The aria-­‐expanded="false" attribute can be used to announce the current state of the popup button to screen readers - i.e the dropdown below the button is not currently expanded.
  • 28. The "false" value would need to be changed to "true" via JavaScript as soon as the user triggers the button.
  • 29. <button      type="button"   aria-­‐label="Current  company:  Weyland  Industries.  Use   the  dropdown  menu  to  switch  companies"      aria-­‐haspopup="true"      aria-­‐expanded="false"   >      Weyland  Industries   </button>
  • 30. Alternatively, the aria-­‐ expanded="true" attribute could be injected via JavaScript only when the button is triggered - which would reduce the amount of information being announced.
  • 32. For keyboard-only users, ENTER or SPACEBAR strokes should trigger the dropdown to appear.
  • 33. 5. After the button is triggered
  • 34. If the aria-­‐expanded="false" attribute is present in the default button state, it should be changed to aria-­‐expanded="true" via JavaScript.
  • 35. If the aria-­‐expanded="false" attribute is not present in the default button state, the aria-­‐ expanded="true" should be injected via JavaScript.
  • 36. <button      type="button"   aria-­‐label="Current  company:  Weyland  Industries.  Use   the  dropdown  menu  to  switch  companies"      aria-­‐haspopup="true"      aria-­‐expanded="true"   >      Weyland  Industries   </button>
  • 37. Focus should immediately shift to the <ul> element and the dropdown should become visible.
  • 38. This is something that most button dropdown solutions do not solve elegantly. In many cases, users trigger the button but the focus does not shift at all.
  • 39. Users are either given silence after they trigger the button, or the button information is repeated again. This can cause confusion for users who cannot see that the dropdown has been triggered, but nothing has been announced.
  • 40. The <ul> element could be given an aria-­‐label value, which means that when it receives focus, it’s purpose is announced.
  • 41. <ul  aria-­‐label="Switch  Companies">      <li><a  href="#">Weyland  Industries</a></li>      <li><a  href="#">Stark  Industries</a></li>      <li><a  href="#">Cyberdyne  Systems</a></li>   </ul>  
  • 42. A side note:
 If the current organisation exists in the long list of dropdown items, it may be a good ideal to flag this item as the current organisation for screen reader users.
  • 43. This can be achieved with a range of different methods, including providing additional information that is hidden off-screen.
  • 44. <ul  aria-­‐label="Switch  Companies">      <li>          <a  href="#">              <span  class="hidden">Current  company:  </span>              Weyland  Industries          </a>      </li>      <li><a  href="#">Stark  Industries</a></li>      <li><a  href="#">Cyberdyne  Systems</a></li>   </ul>
  • 45. 8. To escape the dropdown
  • 46. For keyboard-only users, the ESC keystroke should close the dropdown and return focus to the button.
  • 47. 7. To navigate through items within the dropdown
  • 48. When focus has shifted to the <ul> element, keyboard-only users should be able to use TAB, SHIFT TAB, UP ARROW or DOWN ARROW to move forwards or backwards through the list items.
  • 49. When users reach the start or end of the list, UP ARROW and DOWN ARROW keystrokes should then have not have any effect.
  • 51. Keyboard-only users should be able to select a dropdown menu item using ENTER and possibly the SPACEBAR keystrokes.
  • 52. 9. To leave the dropdown
  • 53. Keyboard-only users should be able to TAB forward through the dropdown items and then on to other focusable items outside the dropdown.
  • 54. As soon focus leave the last dropdown item, the dropdown should disappear.
  • 55. Users should be able to SHIFT TAB backwards through the dropdown items and back to the button.
  • 56. The dropdown should remain open when the button receives focus. (Users can close the dropdown by triggering the button again).
  • 58. So, that’s it. A few simple pointers to help make button dropdowns more accessible. Thanks for listening!
  • 59. Russ Weakley Max Design Site: maxdesign.com.au Twitter: twitter.com/russmaxdesign Slideshare: slideshare.net/maxdesign Linkedin: linkedin.com/in/russweakley