SlideShare ist ein Scribd-Unternehmen logo
1 von 59
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

User Interfaces beyond the screen
User Interfaces beyond the screenUser Interfaces beyond the screen
User Interfaces beyond the screenJason Mesut
 
Building Digital Strategy Roadmap For Digital Transformation Complete Deck
Building Digital Strategy Roadmap For Digital Transformation Complete DeckBuilding Digital Strategy Roadmap For Digital Transformation Complete Deck
Building Digital Strategy Roadmap For Digital Transformation Complete DeckSlideTeam
 
Social Media Strategy For 2023.pdf
Social Media Strategy For 2023.pdfSocial Media Strategy For 2023.pdf
Social Media Strategy For 2023.pdfAmit Singh
 
The Other C Word: What makes great content marketing great
The Other C Word: What makes great content marketing greatThe Other C Word: What makes great content marketing great
The Other C Word: What makes great content marketing greatVelocity Partners
 
13 things you didn’t know you could do with the S Pen
13 things you didn’t know you could do with the S Pen13 things you didn’t know you could do with the S Pen
13 things you didn’t know you could do with the S PenSamsung Business USA
 
Top 10 Learnings Growing to (Almost) $10 Million ARR: Leo's presentation at S...
Top 10 Learnings Growing to (Almost) $10 Million ARR: Leo's presentation at S...Top 10 Learnings Growing to (Almost) $10 Million ARR: Leo's presentation at S...
Top 10 Learnings Growing to (Almost) $10 Million ARR: Leo's presentation at S...Buffer
 
SlideShare Experts - 7 Experts Reveal Their Presentation Design Secrets
SlideShare Experts - 7 Experts Reveal Their Presentation Design SecretsSlideShare Experts - 7 Experts Reveal Their Presentation Design Secrets
SlideShare Experts - 7 Experts Reveal Their Presentation Design SecretsEugene Cheng
 
How to get things done - Lessons from Yahoo, Google, Netflix and Meta
How to get things done - Lessons from Yahoo, Google, Netflix and Meta How to get things done - Lessons from Yahoo, Google, Netflix and Meta
How to get things done - Lessons from Yahoo, Google, Netflix and Meta Ido Green
 
Things That Don't Matter in Your Presentation!
Things That Don't Matter in Your Presentation!Things That Don't Matter in Your Presentation!
Things That Don't Matter in Your Presentation!Ayman Sadiq
 
140 Book Marketing Ideas to Help Authors Increase Sales
140 Book Marketing Ideas to Help Authors Increase Sales140 Book Marketing Ideas to Help Authors Increase Sales
140 Book Marketing Ideas to Help Authors Increase SalesAdrienne Jack
 
Top Social Media Marketing Trends to Follow in 2023
Top Social Media Marketing Trends to Follow in 2023Top Social Media Marketing Trends to Follow in 2023
Top Social Media Marketing Trends to Follow in 2023Jomer Gregorio
 
Five Killer Ways to Design The Same Slide
Five Killer Ways to Design The Same SlideFive Killer Ways to Design The Same Slide
Five Killer Ways to Design The Same SlideCrispy Presentations
 
Benefits of drinking water
Benefits of drinking waterBenefits of drinking water
Benefits of drinking waterEason Chan
 
Designing the Future: When Fact Meets Fiction
Designing the Future: When Fact Meets FictionDesigning the Future: When Fact Meets Fiction
Designing the Future: When Fact Meets FictionDean Johnson
 
The Great State of Design with CSS Grid Layout and Friends
The Great State of Design with CSS Grid Layout and FriendsThe Great State of Design with CSS Grid Layout and Friends
The Great State of Design with CSS Grid Layout and FriendsStacy Kvernmo
 
Falcon.io 2022 Social Media Trends
Falcon.io 2022 Social Media TrendsFalcon.io 2022 Social Media Trends
Falcon.io 2022 Social Media TrendsFalcon.io
 
The Art of the Presentation
The Art of the PresentationThe Art of the Presentation
The Art of the PresentationJeffrey Stevens
 

Was ist angesagt? (20)

User Interfaces beyond the screen
User Interfaces beyond the screenUser Interfaces beyond the screen
User Interfaces beyond the screen
 
Building Digital Strategy Roadmap For Digital Transformation Complete Deck
Building Digital Strategy Roadmap For Digital Transformation Complete DeckBuilding Digital Strategy Roadmap For Digital Transformation Complete Deck
Building Digital Strategy Roadmap For Digital Transformation Complete Deck
 
Social Media Strategy For 2023.pdf
Social Media Strategy For 2023.pdfSocial Media Strategy For 2023.pdf
Social Media Strategy For 2023.pdf
 
The Other C Word: What makes great content marketing great
The Other C Word: What makes great content marketing greatThe Other C Word: What makes great content marketing great
The Other C Word: What makes great content marketing great
 
13 things you didn’t know you could do with the S Pen
13 things you didn’t know you could do with the S Pen13 things you didn’t know you could do with the S Pen
13 things you didn’t know you could do with the S Pen
 
Top 10 Learnings Growing to (Almost) $10 Million ARR: Leo's presentation at S...
Top 10 Learnings Growing to (Almost) $10 Million ARR: Leo's presentation at S...Top 10 Learnings Growing to (Almost) $10 Million ARR: Leo's presentation at S...
Top 10 Learnings Growing to (Almost) $10 Million ARR: Leo's presentation at S...
 
SlideShare Experts - 7 Experts Reveal Their Presentation Design Secrets
SlideShare Experts - 7 Experts Reveal Their Presentation Design SecretsSlideShare Experts - 7 Experts Reveal Their Presentation Design Secrets
SlideShare Experts - 7 Experts Reveal Their Presentation Design Secrets
 
How to get things done - Lessons from Yahoo, Google, Netflix and Meta
How to get things done - Lessons from Yahoo, Google, Netflix and Meta How to get things done - Lessons from Yahoo, Google, Netflix and Meta
How to get things done - Lessons from Yahoo, Google, Netflix and Meta
 
Things That Don't Matter in Your Presentation!
Things That Don't Matter in Your Presentation!Things That Don't Matter in Your Presentation!
Things That Don't Matter in Your Presentation!
 
140 Book Marketing Ideas to Help Authors Increase Sales
140 Book Marketing Ideas to Help Authors Increase Sales140 Book Marketing Ideas to Help Authors Increase Sales
140 Book Marketing Ideas to Help Authors Increase Sales
 
Top Social Media Marketing Trends to Follow in 2023
Top Social Media Marketing Trends to Follow in 2023Top Social Media Marketing Trends to Follow in 2023
Top Social Media Marketing Trends to Follow in 2023
 
Five Killer Ways to Design The Same Slide
Five Killer Ways to Design The Same SlideFive Killer Ways to Design The Same Slide
Five Killer Ways to Design The Same Slide
 
Benefits of drinking water
Benefits of drinking waterBenefits of drinking water
Benefits of drinking water
 
Designing the Future: When Fact Meets Fiction
Designing the Future: When Fact Meets FictionDesigning the Future: When Fact Meets Fiction
Designing the Future: When Fact Meets Fiction
 
7 insights of Indonesia
7 insights of Indonesia7 insights of Indonesia
7 insights of Indonesia
 
The Great State of Design with CSS Grid Layout and Friends
The Great State of Design with CSS Grid Layout and FriendsThe Great State of Design with CSS Grid Layout and Friends
The Great State of Design with CSS Grid Layout and Friends
 
Falcon.io 2022 Social Media Trends
Falcon.io 2022 Social Media TrendsFalcon.io 2022 Social Media Trends
Falcon.io 2022 Social Media Trends
 
The Art of the Presentation
The Art of the PresentationThe Art of the Presentation
The Art of the Presentation
 
You Suck At PowerPoint!
You Suck At PowerPoint!You Suck At PowerPoint!
You Suck At PowerPoint!
 
Americans and CEO Pay: 2016 Public Perception Survey on CEO Compensation
Americans and CEO Pay: 2016 Public Perception Survey on CEO CompensationAmericans and CEO Pay: 2016 Public Perception Survey on CEO Compensation
Americans and CEO Pay: 2016 Public Perception Survey on CEO Compensation
 

Ähnlich wie Creating an Accessible button dropdown

Accessible modal windows
Accessible modal windowsAccessible modal windows
Accessible modal windowsRuss Weakley
 
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
 

Ähnlich wie Creating an Accessible button dropdown (20)

Accessible modal windows
Accessible modal windowsAccessible modal windows
Accessible modal windows
 
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
 

Mehr von 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
 
Accessible states in Design Systems
Accessible states in Design SystemsAccessible states in Design Systems
Accessible states in Design SystemsRuss 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
 

Mehr von 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?
 
Accessible states in Design Systems
Accessible states in Design SystemsAccessible states in Design Systems
Accessible states in Design Systems
 
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
 

Kürzlich hochgeladen

USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxnelietumpap1
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 

Kürzlich hochgeladen (20)

USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.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