SlideShare ist ein Scribd-Unternehmen logo
1 von 188
Downloaden Sie, um offline zu lesen
Accessible
modal
windows
What is a modal
window?
A modal window is a window
that forces the user to interact
with it before they can go back to
using the parent page.
Generally, modal windows are
designed to sit over the top of
the parent page. In some cases,
the parent page is greyed out so
that users can visually focus on the
modal dialog only.
Different types of
modal window
Modal windows can be used for
all sorts of different roles such
as:
Modal alerts
Modal dialogs
Modal lightboxes
Modeless windows
Modal windows should not be
mistaken for modeless windows.
Modeless windows are secondary
windows that stay active on the
user's screen until dismissed.
Modeless windows can be
minimised or hidden behind other
windows.
Unlike a modal window, a
modeless window will allow the
user to continue working with
the application while the modeless
window is still open.
What makes an
accessible modal
window?
Keyboard only
Users must be able to navigate
through the modal window as
needed using keyboard-only.
Users should be able to close the
modal window using keyboard-
only.
Users should not be able to TAB
outside of the modal window
until the modal window has been
closed.
There should be no hidden
keystrokes as users move through
the modal window.
Screen reader
All relevant components should be
identified to screen reader users
as they are accessed.
Screen readers should be notified
of changes as they occur.
Focus should be placed on
relevant areas as changes occur.
General user
The process should be easy to
understand for any type of user -
keyboard only user, screen reader
user, general user.
Informing users
before modal
window spawning
If a modal window spawns from a
focusable element, screen reader
users should be given additional
information to let them know
what will happen.
This can be done using a range of
different methods, depending on
the element that is used.
Hyperlinks
For hyperlinks, we could add
additional information using the
“title”, aria-labelledby, or “aria-
label” attributes. Or we could
place the addition information
inside the link and then hide it.
<!-- title attribute -->!
<a href="#id-name" !
! title="Added info">!
! Add bank account!
</a>!
<!-- aria-label attribute -->!
<a href="#id-name" !
! aria-label="Add bank account - Added
info">!
! Add bank account!
</a>!
<!-- aria-labelledby attribute -->!
<a href="#id-name" !
! aria-labelledby="info1">!
! Add bank account!
</a>!
<p id="info1" class="hidden">!
! Added info!
</p>!
<!-- hidden info -->!
<a href="#id-name">!
! Add bank account!
! <span class="hidden">Added info</span>!
</a>!
Buttons
For <button> elements, we
could use any of these same
techniques.
<!-- title attribute -->!
<button id="id-name" !
! title="Added info">!
! Add bank account!
</button>!
<!-- aria-label attribute -->!
<button id="id-name" !
! aria-label="Add bank account - Added
info">!
! Add bank account!
</button>!
<!-- aria-labelledby attribute -->!
<button id="id-name" !
! aria-labelledby="info1">!
! Add bank account!
</button>!
<p id="info1" class="hidden">!
! Added info!
</p>!
<!-- hidden info -->!
<button id="id-name">!
! Add bank account!
! <span class="hidden">Added info</span>!
</button>!
Inputs
For <input> elements, we could
use any of these same techniques -
except the hidden method as we
cannot place HTML markup inside
input elements.
Images
For <img> elements, we could
use any of the above techniques or
even add info into the “alt”
attribute.
<!-- alt attribute -->!
<a href="#id-name">!
! <img src="a.gif" !
! alt="Add bank account - Added info">!
</a>!
Hiding and
showing modal
windows
1. Hiding the modal
window
Initially, we need to hide the
modal dialog content so that is
not seen by sighted users or heard
by screen reader users.
<!-- hiding modal window -->!
<div!
! style="display:none">!
! ...!
</div>!
2. Showing the modal
window
When a user triggers the modal
window, we need to use
JavaScript to switch the values
within these two attributes.
The “display” value needs to
change from “none” to “block”.
<!-- aria-hidden -->!
<div!
! style="display:block">!
! ...!
</div>!
When the modal window becomes
active, the rest of the page -
everything apart from the modal
window container, could then be
set with aria-hidden=“true”.
<!-- all other content -->!
<div!
! aria-hidden="true">!
! ...!
</div>!
!
<!-- modal window -->!
<div!
! style="display:block">!
! ...!
</div>!
!
Notifying screen
readers when
arriving at modal
window
When a modal window is
spawned, we need to provide a
range of information to screen
reader users.
1. Setting focus on the
modal window
The first thing we need to do
when a modal window spawns is
set the initial focus to the modal
window element itself.
Initial focus
This is important because we are
going to give the window a label
as well as potentially adding
additional descriptive information.
If we set focus on an element
inside the window, such as the
first form control, the label and
additional information will not
be heard by screen reader users.
Initial focus
2. Add“dialog”role
We need to inform screen reader
users that this modal window is a
“modal dialog”. We can do this by
adding role=“dialog”.
<!-- adding aria role -->!
<div!
! style="display:block"!
! aria-hidden="false"!
! role="dialog">!
! ...!
</div>
3. Adding a label
We need to provide a label for
the modal dialog, so screen
reader users know its purpose.
We can do this by linking the
modal dialog container to the
primary <hn> element using
“aria-labeledby”.
<!-- adding aria labelledby -->!
<div!
! style="display:block"!
! aria-hidden="false"!
! role="dialog"!
! aria-labelledby="modal-label">!
! <h1 id="modal-label">!
! ! Choose account!
! </h1>!
</div>!
Now the heading will be
announced to screen reader
users when the modal dialog is
spawned.
4. Adding optional
additional information
In some circumstances, such as
complex modal dialogs, we may
need to provide a more detailed
description of the purpose of the
modal dialog.
We can provide additional
information by linking the modal
dialog container to some
descriptive content using “aria-
describedby”.
<!-- adding aria labelledby -->!
<div!
! style="display:block"!
! aria-hidden="false"!
! role="dialog"!
! aria-labelledby="modal-label"!
! aria-describedby="modal-description">!
! <h1 id="modal-label">!
! ! Choose account!
! </h1>!
! <p id="modal-description">!
! ! Description here!
! </p>!
</div>!
Ideally, this content should be
hidden or placed at the end of
the modal dialog content, after
all other content in the source.
Otherwise it can be read-aloud
twice in quick succession by
screen readers, which can be
confusing for some users.
5. Working with older
Assistive Technologies?
What about older assistive
technologies that may not
support some of the more
advanced ARIA attributes?
If this is an issue, other simpler
options may need to be
considered.
One simple option would be to
provide a special focusable
element, such as a link, that
comes before all others.
This could be presented as a
simple “Information” icon that
sits in the top left corner of the
window.
We could then add a description
of the modal window to this link.
<!-- help info -->!
<a href="#id-name">!
! <img src="a.gif" alt="Help">!
! <span class="tooltip">Added info</span>!
</a>!
!
This method could be useful for
both screen reader users and
general users, as the information
could be made visible as a
tooltip on focus.
Actions outside
the modal window
Users should not be able to
mouse-click on any focusable
element outside the modal
window while it is open.
CLICK
Users should not be able to use
TAB keystrokes to focus on any
focusable element outside the
modal window while it is open.
TAB
Actions inside
modal window
Mouse
Users should be able to mouse-
click to enable any focusable
element inside the modal window
while it is open.
CLICK
CLICK
CLICK
CLICK
CLICK
CLICK
CLICK
TAB keystroke
Users should be able to use TAB
keystrokes to navigate to any
focusable element inside the
modal window while it is open.
TAB
TAB
TAB
TAB
TAB
TAB
TAB
SHIFT + TAB keystroke
Users should be able to use
SHIFT + TAB keystrokes to
navigate backwards to any
focusable element inside the
modal window while it is open.
SHIFT + TAB
SHIFT + TAB
SHIFT + TAB
SHIFT + TAB
SHIFT + TAB
SHIFT + TAB
SHIFT + TAB
ENTER and SPACE
keystrokes
Users should be able to use
ENTER or SPACE keystrokes on
relevant elements while inside the
modal window - especially if they
are button elements.
ENTER
ENTER
SPACE
SPACE
ARROW keystrokes
When inside form controls,
ARROW keys are generally used to
allow users to navigate user-
entered text within the form
control.
An example might be a user
entering data into a <textarea>
element. The user can navigate
within their entered text using
ARROW keys to move to previous
and next characters, next line etc.
However, some form controls use
ARROW keys to allow users to
choose options within a set of
choices.
For example, radio buttons and
select menus allow users to
navigate through choices using
ARROW keys.
So, users should be able to use
ARROW keystrokes to change
radio button options.
TAB
ARROW
Users should be able to use
ARROW keystrokes to change
select menu options.
Option 1 - apples
ARROW
Option 2 - pears
ARROW
Option 3 - bananas
ARROW
ESC keystroke
Users should be able to use the
ESC key to close modal.
ESC
Modal windows
and screen reader
“read” mode
Screen readers generally operate
in one of two modes: ‘read’ mode
and ‘form’ mode.
In “read” mode, users can read
and navigate the page. Users
cannot interact with form controls
In “form” mode, users can interact
with form controls. Users cannot
read and navigate the page.
In some cases, modal windows
may include important content
that is not form-related. In these
cases, screen reader users need to
be able to operate in “read” mode.
This means that screen reader
users must be able to navigate
though content using all of the
standard “read” mode keys.
In these cases, we could wrap a
new element around all the
content within the window and
set it with role=“document”.
The “document” role informs
screen readers of the need to
augment browser keyboard
support so that users can navigate
and read any content within the
“document” region.
<!-- adding aria role -->!
<div!
! style="display:block"!
! aria-hidden="false"!
! role="dialog"!
! aria-labelledby="modal-label"!
! aria-describedby="modal-description">!
! <div role="document">!
! ! <h1 id="modal-label">!
! ! ! Choose account!
! ! </h1>!
! ! <p id="modal-description">!
! ! ! Description here!
! ! </p>!
! </div>!
Adding meaning to
important actions
For some important actions inside
the modal window, screen reader
users should be given additional
information to let them know
what will happen.
Submit
As screen reader users are
submitting form data, they
should be informed that:
1. they will be taken back to the
parent page.
2. where this data will be
submitted when they return to
the parent page.
ENTER
“Submit and return to bank
balance information. Your
data will be added to the
Balance table”
Close window
As screen reader users focus on
the “Close” function, they should
be informed that closing will
take them back to the parent
page.
ENTER
“Leave form and return to
bank balance information”
A question on tab
order
Is it better to present to “Close”
button before any form controls in
tab order, or after any form
controls.
A lot will depend on the
complexity and amount of
content inside the modal window.
Simple modal windows
For simple modal windows, it may
be easier to place the “Close”
button last in tab order.
1
2
3
Complex modal windows
For complex modal windows,
where users may want to go back
to the parent page quickly without
having to TAB through the whole
window, it may be better to place
the “Close” button first in tab
order.
1
2
3
4
5
6
On sites where there are
numerous different modal dialogs,
the most important thing is
consistency. Decided on a method
and use it for all modal windows
so that it becomes predictable.
After modal dialog
closes
When the modal window is closed,
if users are being taken back to
the parent page:
1. Focus should be placed on the
relevant component of the parent
page. The most common practice
is to move focus back to the
element that invoked the dialog.
The user should not be thrown
back to the top of the parent
page unless there is a good
reason!
2. The user should be informed
where they are and what change
has occurred.
ENTER
Lorem ipsum dolor sit amet consect etuer adipi scing elit sed diam
nonummy nibh euismod tinunt ut laoreet dolore magna aliquam
erat volut. Ut wisi enim ad minim veniam, quis nostrud exerci tation
ullamcorper suscipit lobortis nisl ut aliquip vel eum iriure dolor in
hendrerit in vulputate.
Accumsan et iusto odio dignissim qui blandit praesent luptatum
zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum
dolor sit amet, consectetuer adipiscing elit, sed diam nonummy
nibh euismod tincidunt ut laoreet dolore magna aliquam erat.
Heading here
Another thing here
Add your bank balance
Another heading
$1,200.34
Focus
“Bank balance $1200.34 added
to bank information table”
Thanks to…
A huge thanks to Roger Hudson,
Steve Faulkner and James
Edwards for their advice and
feedback on these slides.
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?

Introduction to java ee
Introduction to java eeIntroduction to java ee
Introduction to java ee
Ranjan Kumar
 
Usability Testing Methods
Usability Testing MethodsUsability Testing Methods
Usability Testing Methods
dillarja
 
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
Clément Wehrung
 

Was ist angesagt? (20)

Builder design pattern
Builder design patternBuilder design pattern
Builder design pattern
 
Introduction to java ee
Introduction to java eeIntroduction to java ee
Introduction to java ee
 
What’s the difference between a UX and UI designer? (Part two)
What’s the difference between a UX and UI designer? (Part two)What’s the difference between a UX and UI designer? (Part two)
What’s the difference between a UX and UI designer? (Part two)
 
Flyweight pattern
Flyweight patternFlyweight pattern
Flyweight pattern
 
Ui design
Ui designUi design
Ui design
 
CSS media types
CSS media typesCSS media types
CSS media types
 
UI Design Patterns for the Web, Part 1
UI Design Patterns for the Web, Part 1UI Design Patterns for the Web, Part 1
UI Design Patterns for the Web, Part 1
 
HTML 5 Canvas & SVG
HTML 5 Canvas & SVGHTML 5 Canvas & SVG
HTML 5 Canvas & SVG
 
Introduction to WAI-ARIA
Introduction to WAI-ARIAIntroduction to WAI-ARIA
Introduction to WAI-ARIA
 
Usability Testing Methods
Usability Testing MethodsUsability Testing Methods
Usability Testing Methods
 
iOS Architectures
iOS ArchitecturesiOS Architectures
iOS Architectures
 
Introduction to Web Components
Introduction to Web ComponentsIntroduction to Web Components
Introduction to Web Components
 
User interface design
User interface designUser interface design
User interface design
 
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
 
Html 5 Features And Benefits
Html 5 Features And Benefits  Html 5 Features And Benefits
Html 5 Features And Benefits
 
Solid principles
Solid principlesSolid principles
Solid principles
 
Microinteractions
MicrointeractionsMicrointeractions
Microinteractions
 
Basics of Web Accessibility
Basics of Web AccessibilityBasics of Web Accessibility
Basics of Web Accessibility
 
Responsive web design
Responsive web designResponsive web design
Responsive web design
 
Dotnet basics
Dotnet basicsDotnet basics
Dotnet basics
 

Ähnlich wie Accessible modal windows

Ähnlich wie Accessible modal windows (20)

Front End Frameworks - are they accessible
Front End Frameworks - are they accessibleFront End Frameworks - are they accessible
Front End Frameworks - are they accessible
 
Building Accessible Web Components
Building Accessible Web ComponentsBuilding Accessible Web Components
Building Accessible Web Components
 
Creating an Accessible button dropdown
Creating an Accessible button dropdownCreating an Accessible button dropdown
Creating an Accessible button dropdown
 
Creating accessible modals and autocompletes
Creating accessible modals and autocompletesCreating accessible modals and autocompletes
Creating accessible modals and autocompletes
 
Building accessible web components without tears
Building accessible web components without tearsBuilding accessible web components without tears
Building accessible web components without tears
 
WAI-ARIA An introduction to Accessible Rich Internet Applications / AccessU 2018
WAI-ARIA An introduction to Accessible Rich Internet Applications / AccessU 2018WAI-ARIA An introduction to Accessible Rich Internet Applications / AccessU 2018
WAI-ARIA An introduction to Accessible Rich Internet Applications / AccessU 2018
 
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 code-patterns
Accessible code-patternsAccessible code-patterns
Accessible code-patterns
 
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
 
ARIA and JavaScript Accessibility
ARIA and JavaScript AccessibilityARIA and JavaScript Accessibility
ARIA and JavaScript Accessibility
 
Semantic accessibility
Semantic accessibilitySemantic accessibility
Semantic accessibility
 
WAI-ARIA An introduction to Accessible Rich Internet Applications / JavaScrip...
WAI-ARIA An introduction to Accessible Rich Internet Applications / JavaScrip...WAI-ARIA An introduction to Accessible Rich Internet Applications / JavaScrip...
WAI-ARIA An introduction to Accessible Rich Internet Applications / JavaScrip...
 
WAI-ARIA An introduction to Accessible Rich Internet Applications / CSS Minsk...
WAI-ARIA An introduction to Accessible Rich Internet Applications / CSS Minsk...WAI-ARIA An introduction to Accessible Rich Internet Applications / CSS Minsk...
WAI-ARIA An introduction to Accessible Rich Internet Applications / CSS Minsk...
 
Creating Acessible floating labels
Creating Acessible floating labelsCreating Acessible floating labels
Creating Acessible floating labels
 
jQuery mobile UX
jQuery mobile UXjQuery mobile UX
jQuery mobile UX
 
Bootstrap cheat-sheet-websitesetup.org
Bootstrap cheat-sheet-websitesetup.org Bootstrap cheat-sheet-websitesetup.org
Bootstrap cheat-sheet-websitesetup.org
 
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
 
Making modal dialogs accessible
Making modal dialogs accessibleMaking modal dialogs accessible
Making modal dialogs accessible
 
Show & tell - A more accessible accordion
Show & tell - A more accessible accordionShow & tell - A more accessible accordion
Show & tell - A more accessible accordion
 
Pruexx User's guide for beta testing
Pruexx User's guide for beta testingPruexx User's guide for beta testing
Pruexx User's guide for beta testing
 

Mehr von Russ Weakley

Mehr von Russ Weakley (19)

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
 
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
 
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
 
Specialise or cross-skill
Specialise or cross-skillSpecialise or cross-skill
Specialise or cross-skill
 
CSS pattern libraries
CSS pattern librariesCSS pattern libraries
CSS pattern libraries
 
Responsive Web Design - more than just a buzzword
Responsive Web Design - more than just a buzzwordResponsive Web Design - more than just a buzzword
Responsive Web Design - more than just a buzzword
 

Kürzlich hochgeladen

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
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
heathfieldcps1
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Kürzlich hochgeladen (20)

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
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
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
 
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
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
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.
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
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
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 

Accessible modal windows

  • 2. What is a modal window?
  • 3. A modal window is a window that forces the user to interact with it before they can go back to using the parent page.
  • 4. Generally, modal windows are designed to sit over the top of the parent page. In some cases, the parent page is greyed out so that users can visually focus on the modal dialog only.
  • 5.
  • 7. Modal windows can be used for all sorts of different roles such as:
  • 12. Modal windows should not be mistaken for modeless windows.
  • 13. Modeless windows are secondary windows that stay active on the user's screen until dismissed. Modeless windows can be minimised or hidden behind other windows.
  • 14. Unlike a modal window, a modeless window will allow the user to continue working with the application while the modeless window is still open.
  • 15. What makes an accessible modal window?
  • 17. Users must be able to navigate through the modal window as needed using keyboard-only.
  • 18. Users should be able to close the modal window using keyboard- only.
  • 19. Users should not be able to TAB outside of the modal window until the modal window has been closed.
  • 20. There should be no hidden keystrokes as users move through the modal window.
  • 22. All relevant components should be identified to screen reader users as they are accessed.
  • 23. Screen readers should be notified of changes as they occur.
  • 24. Focus should be placed on relevant areas as changes occur.
  • 26. The process should be easy to understand for any type of user - keyboard only user, screen reader user, general user.
  • 28. If a modal window spawns from a focusable element, screen reader users should be given additional information to let them know what will happen.
  • 29. This can be done using a range of different methods, depending on the element that is used.
  • 31. For hyperlinks, we could add additional information using the “title”, aria-labelledby, or “aria- label” attributes. Or we could place the addition information inside the link and then hide it.
  • 32. <!-- title attribute -->! <a href="#id-name" ! ! title="Added info">! ! Add bank account! </a>!
  • 33. <!-- aria-label attribute -->! <a href="#id-name" ! ! aria-label="Add bank account - Added info">! ! Add bank account! </a>!
  • 34. <!-- aria-labelledby attribute -->! <a href="#id-name" ! ! aria-labelledby="info1">! ! Add bank account! </a>! <p id="info1" class="hidden">! ! Added info! </p>!
  • 35. <!-- hidden info -->! <a href="#id-name">! ! Add bank account! ! <span class="hidden">Added info</span>! </a>!
  • 37. For <button> elements, we could use any of these same techniques.
  • 38. <!-- title attribute -->! <button id="id-name" ! ! title="Added info">! ! Add bank account! </button>!
  • 39. <!-- aria-label attribute -->! <button id="id-name" ! ! aria-label="Add bank account - Added info">! ! Add bank account! </button>!
  • 40. <!-- aria-labelledby attribute -->! <button id="id-name" ! ! aria-labelledby="info1">! ! Add bank account! </button>! <p id="info1" class="hidden">! ! Added info! </p>!
  • 41. <!-- hidden info -->! <button id="id-name">! ! Add bank account! ! <span class="hidden">Added info</span>! </button>!
  • 43. For <input> elements, we could use any of these same techniques - except the hidden method as we cannot place HTML markup inside input elements.
  • 45. For <img> elements, we could use any of the above techniques or even add info into the “alt” attribute.
  • 46. <!-- alt attribute -->! <a href="#id-name">! ! <img src="a.gif" ! ! alt="Add bank account - Added info">! </a>!
  • 48. 1. Hiding the modal window
  • 49. Initially, we need to hide the modal dialog content so that is not seen by sighted users or heard by screen reader users.
  • 50. <!-- hiding modal window -->! <div! ! style="display:none">! ! ...! </div>!
  • 51. 2. Showing the modal window
  • 52. When a user triggers the modal window, we need to use JavaScript to switch the values within these two attributes.
  • 53. The “display” value needs to change from “none” to “block”.
  • 54. <!-- aria-hidden -->! <div! ! style="display:block">! ! ...! </div>!
  • 55. When the modal window becomes active, the rest of the page - everything apart from the modal window container, could then be set with aria-hidden=“true”.
  • 56. <!-- all other content -->! <div! ! aria-hidden="true">! ! ...! </div>! ! <!-- modal window -->! <div! ! style="display:block">! ! ...! </div>! !
  • 58. When a modal window is spawned, we need to provide a range of information to screen reader users.
  • 59. 1. Setting focus on the modal window
  • 60. The first thing we need to do when a modal window spawns is set the initial focus to the modal window element itself.
  • 62. This is important because we are going to give the window a label as well as potentially adding additional descriptive information.
  • 63. If we set focus on an element inside the window, such as the first form control, the label and additional information will not be heard by screen reader users.
  • 66. We need to inform screen reader users that this modal window is a “modal dialog”. We can do this by adding role=“dialog”.
  • 67. <!-- adding aria role -->! <div! ! style="display:block"! ! aria-hidden="false"! ! role="dialog">! ! ...! </div>
  • 68. 3. Adding a label
  • 69. We need to provide a label for the modal dialog, so screen reader users know its purpose.
  • 70. We can do this by linking the modal dialog container to the primary <hn> element using “aria-labeledby”.
  • 71. <!-- adding aria labelledby -->! <div! ! style="display:block"! ! aria-hidden="false"! ! role="dialog"! ! aria-labelledby="modal-label">! ! <h1 id="modal-label">! ! ! Choose account! ! </h1>! </div>!
  • 72. Now the heading will be announced to screen reader users when the modal dialog is spawned.
  • 74. In some circumstances, such as complex modal dialogs, we may need to provide a more detailed description of the purpose of the modal dialog.
  • 75. We can provide additional information by linking the modal dialog container to some descriptive content using “aria- describedby”.
  • 76. <!-- adding aria labelledby -->! <div! ! style="display:block"! ! aria-hidden="false"! ! role="dialog"! ! aria-labelledby="modal-label"! ! aria-describedby="modal-description">! ! <h1 id="modal-label">! ! ! Choose account! ! </h1>! ! <p id="modal-description">! ! ! Description here! ! </p>! </div>!
  • 77. Ideally, this content should be hidden or placed at the end of the modal dialog content, after all other content in the source.
  • 78. Otherwise it can be read-aloud twice in quick succession by screen readers, which can be confusing for some users.
  • 79. 5. Working with older Assistive Technologies?
  • 80. What about older assistive technologies that may not support some of the more advanced ARIA attributes?
  • 81. If this is an issue, other simpler options may need to be considered.
  • 82. One simple option would be to provide a special focusable element, such as a link, that comes before all others.
  • 83. This could be presented as a simple “Information” icon that sits in the top left corner of the window.
  • 84.
  • 85. We could then add a description of the modal window to this link.
  • 86. <!-- help info -->! <a href="#id-name">! ! <img src="a.gif" alt="Help">! ! <span class="tooltip">Added info</span>! </a>! !
  • 87. This method could be useful for both screen reader users and general users, as the information could be made visible as a tooltip on focus.
  • 88.
  • 90. Users should not be able to mouse-click on any focusable element outside the modal window while it is open.
  • 91. CLICK
  • 92. Users should not be able to use TAB keystrokes to focus on any focusable element outside the modal window while it is open.
  • 93. TAB
  • 95. Mouse
  • 96. Users should be able to mouse- click to enable any focusable element inside the modal window while it is open.
  • 97. CLICK
  • 98. CLICK
  • 99. CLICK
  • 100. CLICK
  • 101. CLICK
  • 102. CLICK
  • 103. CLICK
  • 105. Users should be able to use TAB keystrokes to navigate to any focusable element inside the modal window while it is open.
  • 106. TAB
  • 107. TAB
  • 108. TAB
  • 109. TAB
  • 110. TAB
  • 111. TAB
  • 112. TAB
  • 113. SHIFT + TAB keystroke
  • 114. Users should be able to use SHIFT + TAB keystrokes to navigate backwards to any focusable element inside the modal window while it is open.
  • 123. Users should be able to use ENTER or SPACE keystrokes on relevant elements while inside the modal window - especially if they are button elements.
  • 124. ENTER
  • 125. ENTER
  • 126. SPACE
  • 127. SPACE
  • 129. When inside form controls, ARROW keys are generally used to allow users to navigate user- entered text within the form control.
  • 130. An example might be a user entering data into a <textarea> element. The user can navigate within their entered text using ARROW keys to move to previous and next characters, next line etc.
  • 131. However, some form controls use ARROW keys to allow users to choose options within a set of choices.
  • 132. For example, radio buttons and select menus allow users to navigate through choices using ARROW keys.
  • 133. So, users should be able to use ARROW keystrokes to change radio button options.
  • 134. TAB
  • 135. ARROW
  • 136. Users should be able to use ARROW keystrokes to change select menu options.
  • 137. Option 1 - apples ARROW
  • 138. Option 2 - pears ARROW
  • 139. Option 3 - bananas ARROW
  • 141. Users should be able to use the ESC key to close modal.
  • 142. ESC
  • 143. Modal windows and screen reader “read” mode
  • 144. Screen readers generally operate in one of two modes: ‘read’ mode and ‘form’ mode.
  • 145. In “read” mode, users can read and navigate the page. Users cannot interact with form controls
  • 146. In “form” mode, users can interact with form controls. Users cannot read and navigate the page.
  • 147. In some cases, modal windows may include important content that is not form-related. In these cases, screen reader users need to be able to operate in “read” mode.
  • 148. This means that screen reader users must be able to navigate though content using all of the standard “read” mode keys.
  • 149. In these cases, we could wrap a new element around all the content within the window and set it with role=“document”.
  • 150. The “document” role informs screen readers of the need to augment browser keyboard support so that users can navigate and read any content within the “document” region.
  • 151. <!-- adding aria role -->! <div! ! style="display:block"! ! aria-hidden="false"! ! role="dialog"! ! aria-labelledby="modal-label"! ! aria-describedby="modal-description">! ! <div role="document">! ! ! <h1 id="modal-label">! ! ! ! Choose account! ! ! </h1>! ! ! <p id="modal-description">! ! ! ! Description here! ! ! </p>! ! </div>!
  • 153. For some important actions inside the modal window, screen reader users should be given additional information to let them know what will happen.
  • 154. Submit
  • 155. As screen reader users are submitting form data, they should be informed that:
  • 156. 1. they will be taken back to the parent page.
  • 157. 2. where this data will be submitted when they return to the parent page.
  • 158. ENTER “Submit and return to bank balance information. Your data will be added to the Balance table”
  • 160. As screen reader users focus on the “Close” function, they should be informed that closing will take them back to the parent page.
  • 161. ENTER “Leave form and return to bank balance information”
  • 162. A question on tab order
  • 163. Is it better to present to “Close” button before any form controls in tab order, or after any form controls.
  • 164. A lot will depend on the complexity and amount of content inside the modal window.
  • 166. For simple modal windows, it may be easier to place the “Close” button last in tab order.
  • 167. 1
  • 168. 2
  • 169. 3
  • 171. For complex modal windows, where users may want to go back to the parent page quickly without having to TAB through the whole window, it may be better to place the “Close” button first in tab order.
  • 172. 1
  • 173. 2
  • 174. 3
  • 175. 4
  • 176. 5
  • 177. 6
  • 178. On sites where there are numerous different modal dialogs, the most important thing is consistency. Decided on a method and use it for all modal windows so that it becomes predictable.
  • 180. When the modal window is closed, if users are being taken back to the parent page:
  • 181. 1. Focus should be placed on the relevant component of the parent page. The most common practice is to move focus back to the element that invoked the dialog.
  • 182. The user should not be thrown back to the top of the parent page unless there is a good reason!
  • 183. 2. The user should be informed where they are and what change has occurred.
  • 184. ENTER
  • 185. Lorem ipsum dolor sit amet consect etuer adipi scing elit sed diam nonummy nibh euismod tinunt ut laoreet dolore magna aliquam erat volut. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip vel eum iriure dolor in hendrerit in vulputate. Accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat. Heading here Another thing here Add your bank balance Another heading $1,200.34 Focus “Bank balance $1200.34 added to bank information table”
  • 187. A huge thanks to Roger Hudson, Steve Faulkner and James Edwards for their advice and feedback on these slides.
  • 188. Russ Weakley Max Design ! Site: maxdesign.com.au Twitter: twitter.com/russmaxdesign Slideshare: slideshare.net/maxdesign Linkedin: linkedin.com/in/russweakley