258
Accessible WEB COMPONENTS

Building Accessible Web Components

Embed Size (px)

Citation preview

Page 1: Building Accessible Web Components

Accessible WEB COMPONENTS

Page 2: Building Accessible Web Components

Who the hell is this guy?

Page 3: Building Accessible Web Components

UX

Accessibility

Front end

Main roles:

Web Design

Page 4: Building Accessible Web Components

Designing & developing

UI Pattern libraries for applications

Working with developers to

build accessible applications

Passions:

Page 5: Building Accessible Web Components

This talk? Some things you can do to make applications more

accessible.

Page 6: Building Accessible Web Components

PART 1

ARIA misuse

Page 7: Building Accessible Web Components

Over the last few years there has been a growing trend to include ARIA attributes in all sorts of

areas in applications.

Page 8: Building Accessible Web Components

Unfortunately, ARIA attributes can be misused, and this can

lead to all sorts of problems for AT users.

Page 9: Building Accessible Web Components

Problem 1: Redundancy

Page 10: Building Accessible Web Components

This is where ARIA is used to provide additional context for assistive technologies, but the native elements already have accessibility APIs available.

Page 11: Building Accessible Web Components

<label  for="a"  aria-­‐label="Add  your  email">     Add  your  email  </label>  <input  type="text"  name="a"  id="a">  

Page 12: Building Accessible Web Components

<button  type="submit"  role="button">     Submit  </button>

Page 13: Building Accessible Web Components

This can lead to problems such as form controls being

announced more than once.

Page 14: Building Accessible Web Components

Problem 2: Overly verbose

Page 15: Building Accessible Web Components

This is where ARIA attributes and additional hidden

information is used extensively across an application.

Page 16: Building Accessible Web Components

This can sometimes lead to excessive amounts of

information being presented to AT users.

Page 17: Building Accessible Web Components

Problem 3: Copy-paste

Page 18: Building Accessible Web Components

This is where developers have copied and pasted components,

often from existing pattern libraries, without

understanding how the ARIA attributes work.

Page 19: Building Accessible Web Components

This can lead to problems such as aria-labels pointing to non-existent ID attributes, so the

ARIA does not work.

Page 20: Building Accessible Web Components

Solutions?

Page 21: Building Accessible Web Components

The simplest guideline is not to use ARIA unless you really

need to.

Page 22: Building Accessible Web Components

“If you can use a native HTML element [HTML5] or attribute with the semantics and behaviour you require already built

in, instead of re-purposing an element and adding an ARIA role, state or property to

make it accessible, then do so.”

Steve Faulkner: http://www.paciellogroup.com/blog/2014/10/aria-in-html-there-goes-the-

neighborhood/

Page 23: Building Accessible Web Components

Where possible, test applications yourself using a

variety of ATs.

Page 24: Building Accessible Web Components

This should include all major screen readers in different

browsers. And don’t forget to test with keyboard only!

Page 25: Building Accessible Web Components

If possible, work with a range of real AT users and get their

input/feedback. Make sure your audience selection includes

different levels of skill.

Page 26: Building Accessible Web Components

PART 2

Adding info for ATs

Page 27: Building Accessible Web Components

The problem

Page 28: Building Accessible Web Components

There may be times when you want to provide additional

information to a link or a button to provide extra context for

screen reader users.

Page 29: Building Accessible Web Components

Purchase

Page 30: Building Accessible Web Components

This “Purchase” link may be acceptable for sighted users who can see the link in context and

do not require additional information.

Page 31: Building Accessible Web Components

However, screen reader users may navigate to this link and

hear the word “Purchase” without any additional

context.

Page 32: Building Accessible Web Components

For these users only, we could provide additional

information to the link:

Page 33: Building Accessible Web Components

“Purchase Don Quixote by Miguel De Cervantes”

Page 34: Building Accessible Web Components

Similarly, there may be times when you want to provide

additional information on a button.

Page 35: Building Accessible Web Components

Close

Page 36: Building Accessible Web Components

“Close and return to Account details”

Page 37: Building Accessible Web Components

Solutions for adding context to links

Page 38: Building Accessible Web Components

There are a range of different methods we could use, such as:

Page 39: Building Accessible Web Components

<a  href="#"  title="Purchase  Don  Quixote  by  Miguel  De  Cervantes">     Purchase  </a>

Page 40: Building Accessible Web Components

Win/IE11

Win/IE8

Win/Chrome

Win/Firefox

OSX/Chrome

OSX/Firefox

OSX/Safari

NVDA

FAIL

FAIL

PASS

PASS

-

-

-

JAWS

PASS

PASS

PASS

PASS

-

-

-

Voiceover

-

-

-

-

FAIL

FAIL

PASS

Page 41: Building Accessible Web Components

<a  href="#"  aria-­‐label="Purchase  Don  Quixote  by  Miguel  De  Cervantes">     Purchase  </a>

Page 42: Building Accessible Web Components

Win/IE11

Win/IE8

Win/Chrome

Win/Firefox

OSX/Chrome

OSX/Firefox

OSX/Safari

NVDA

PASS

PASS

FAIL

PASS

-

-

-

JAWS

PASS

PASS

PASS

PASS

-

-

-

Voiceover

-

-

-

-

PASS

PASS

PASS

Page 43: Building Accessible Web Components

<a  href="#"  aria-­‐labelledby="info1">     Purchase  </a>  <p  id="info1"  class="hidden">     Don  Quixote  by  Miguel  De  Cervantes  </p>

Page 44: Building Accessible Web Components

Win/IE11

Win/IE8

Win/Chrome

Win/Firefox

OSX/Chrome

OSX/Firefox

OSX/Safari

NVDA

PASS

PASS

FAIL

FAIL

-

-

-

JAWS

FAIL

FAIL

FAIL

FAIL

-

-

-

Voiceover

-

-

-

-

PASS

PASS

PASS

Page 45: Building Accessible Web Components

<a  href="#"  aria-­‐describedby="info1">     Purchase  </a>  <p  id="info1"  class="hidden">      Purchase  Don  Quixote  by  Miguel  De  Cervantes  </p>

Page 46: Building Accessible Web Components

Win/IE11

Win/IE8

Win/Chrome

Win/Firefox

OSX/Chrome

OSX/Firefox

OSX/Safari

NVDA

PASS

PASS

PASS

PASS

-

-

-

JAWS

PASS

PASS

PASS

PASS

-

-

-

Voiceover

-

-

-

-

FAIL

PASS

PASS

Page 47: Building Accessible Web Components

<a  href="#">     Purchase       <span  class="hidden">Purchase  Don  Quixote  by  Miguel  De  Cervantes</span>  </a>

Page 48: Building Accessible Web Components

Win/IE11

Win/IE8

Win/Chrome

Win/Firefox

OSX/Chrome

OSX/Firefox

OSX/Safari

NVDA

PASS

PASS

PASS

PASS

-

-

-

JAWS

PASS

PASS

PASS

PASS

-

-

-

Voiceover

-

-

-

-

PASS

PASS

PASS

Page 49: Building Accessible Web Components

The most robust solution involves using hidden content.

Page 50: Building Accessible Web Components

More information at “Adding information to links”:

http://maxdesign.com.au/jobs/sample-accessibility/06-context/05-adding-to-links.html

Page 51: Building Accessible Web Components

Solutions for adding context to buttons

Page 52: Building Accessible Web Components

There are a range of different methods we could use, such as:

Page 53: Building Accessible Web Components

<button  title="and  return  to  Account  details">     Close  </button>

Page 54: Building Accessible Web Components

Win/IE11

Win/IE8

Win/Chrome

Win/Firefox

OSX/Chrome

OSX/Firefox

OSX/Safari

NVDA

FAIL

FAIL

PASS

PASS

-

-

-

JAWS

PASS

PASS

PASS

PASS

-

-

-

Voiceover

-

-

-

-

FAIL

FAIL

FAIL

Page 55: Building Accessible Web Components

<button  aria-­‐label="Close  and  return  to  Account  details">     Close  </button>

Page 56: Building Accessible Web Components

Win/IE11

Win/IE8

Win/Chrome

Win/Firefox

OSX/Chrome

OSX/Firefox

OSX/Safari

NVDA

PASS

PASS

PASS

PASS

-

-

-

JAWS

PASS

PASS

PASS

PASS

-

-

-

Voiceover

-

-

-

-

PASS

PASS

PASS

Page 57: Building Accessible Web Components

<a  href="#"  aria-­‐labelledby="info1">     Close  </a>  <p  id="info1"  class="hidden">     and  return  to  Account  details  </p>

Page 58: Building Accessible Web Components

Win/IE11

Win/IE8

Win/Chrome

Win/Firefox

OSX/Chrome

OSX/Firefox

OSX/Safari

NVDA

PASS

FAIL

FAIL

PASS

-

-

-

JAWS

FAIL

FAIL

FAIL

FAIL

-

-

-

Voiceover

-

-

-

-

FAIL

FAIL

FAIL

Page 59: Building Accessible Web Components

<button  aria-­‐describedby="info1">     Close  </button>  <p  id="info1"  class="hidden">     and  return  to  Account  details  </p>

Page 60: Building Accessible Web Components

Win/IE11

Win/IE8

Win/Chrome

Win/Firefox

OSX/Chrome

OSX/Firefox

OSX/Safari

NVDA

PASS

PASS

PASS

PASS

-

-

-

JAWS

FAIL

FAIL

PASS

PASS

-

-

-

Voiceover

-

-

-

-

FAIL

FAIL

FAIL

Page 61: Building Accessible Web Components

<button>     Close       <span  class="hidden">   and  return  to  Account  details</span>  </button>

Page 62: Building Accessible Web Components

Win/IE11

Win/IE8

Win/Chrome

Win/Firefox

OSX/Chrome

OSX/Firefox

OSX/Safari

NVDA

PASS

PASS

PASS

PASS

-

-

-

JAWS

PASS

PASS

PASS

PASS

-

-

-

Voiceover

-

-

-

-

PASS

PASS

PASS

Page 63: Building Accessible Web Components

The most stable choices are using aria-label or hidden

content.

Page 64: Building Accessible Web Components

More information at “Adding information to buttons”:

http://maxdesign.com.au/jobs/sample-accessibility/06-context/06-adding-to-buttons.html

Page 65: Building Accessible Web Components

A caution

Page 66: Building Accessible Web Components

Providing additional content to screen readers should be used

with care.

Page 67: Building Accessible Web Components

If too much additional information is provided, it can

make web pages or web applications too verbose and

hard to use.

Page 68: Building Accessible Web Components

PART 3

Different info for ATs

Page 69: Building Accessible Web Components

The problem

Page 70: Building Accessible Web Components

There may be times when you want to provide different

content for screen readers to the content that is displayed on-screen - for links and buttons.

Page 71: Building Accessible Web Components

AED $10,640.00

Page 72: Building Accessible Web Components

For example, “AED” may be acceptable for sighted users but may not make sense for screen reader users - especially when

out of context.

Page 73: Building Accessible Web Components

In certain situation, you may want to announce different information to screen reader

users.

Page 74: Building Accessible Web Components

“United Arab Emirates Dirham $10,640.00”

Page 75: Building Accessible Web Components

Similarly, there may be times when you want to provide different content for screen

readers for buttons.

Page 76: Building Accessible Web Components

X

Page 77: Building Accessible Web Components

“Close and return to Account details”

Page 78: Building Accessible Web Components

A solution for different content for

links

Page 79: Building Accessible Web Components

<a  href="#">     <span  aria-­‐hidden="true">       AED     </span>       <span  class="sr-­‐only">       United  Arab  Emirates  Dirham     </span>  </a>

Page 80: Building Accessible Web Components

Win/IE11

Win/IE8

Win/Chrome

Win/Firefox

OSX/Chrome

OSX/Firefox

OSX/Safari

NVDA

PASS

PASS

PASS

PASS

-

-

-

JAWS

PASS

PASS

PASS

PASS

-

-

-

Voiceover

-

-

-

-

PASS

PASS

PASS

Page 81: Building Accessible Web Components

More information at “Display A, announce B - link content”:

http://maxdesign.com.au/jobs/sample-accessibility/06-context/03-different-content-link.html

Page 82: Building Accessible Web Components

A solution for different content for

buttons

Page 83: Building Accessible Web Components

<button  type="button"  aria-­‐label="Close  and  return  to  account  details">     x  </button>

Page 84: Building Accessible Web Components

Win/IE11

Win/IE8

Win/Chrome

Win/Firefox

OSX/Chrome

OSX/Firefox

OSX/Safari

NVDA

PASS

PASS

PASS

PASS

-

-

-

JAWS

PASS

PASS

PASS

PASS

-

-

-

Voiceover

-

-

-

-

PASS

PASS

PASS

Page 85: Building Accessible Web Components

More information at “Display A, announce B - button

content”:

http://maxdesign.com.au/jobs/sample-accessibility/06-context/04-different-content-button.html

Page 86: Building Accessible Web Components

A caution

Page 87: Building Accessible Web Components

Providing different content to screen readers should be used

with care.

Page 88: Building Accessible Web Components

In some situations, providing different information could

potentially confuse Assistive Technology users.

Page 89: Building Accessible Web Components

PART 4

Dynamic content

Page 90: Building Accessible Web Components

The problem

Page 91: Building Accessible Web Components

Well done! Your changes have been saved

Page 92: Building Accessible Web Components

Adding content after the initial page has loaded can cause potential issues for screen

readers.

Page 93: Building Accessible Web Components

Problem 1: Screen readers “buffer” pages as

they are loaded. Any content that is added after this time

many not be picked up by the screen reader.

Page 94: Building Accessible Web Components

Problem 2: Screen readers can only focus on one part of the page at a time. If something changes on another area of the page, screen readers

may not pick this up.

Page 95: Building Accessible Web Components

A solution

Page 96: Building Accessible Web Components

The aria-live attribute allows us to notify screen readers when content is updated in specific

areas of a page.

Page 97: Building Accessible Web Components

We can apply the aria-live attribute to any HTML element.

Page 98: Building Accessible Web Components

<div  aria-­‐live="polite">  

</div>

Page 99: Building Accessible Web Components

If we then use JavaScript to inject/hide/show content within this element, screen readers will

be made aware of any DOM changes within that element.

Page 100: Building Accessible Web Components

The aria-live attribute can be used for any page regions that are likely to get updates after

the initial page is loaded.

Page 101: Building Accessible Web Components

Success alerts! Your changes are saved

Info alerts! Some info to be aware of

Warning alerts! Something has changed

Error alerts! Fix the error and try again

Page 102: Building Accessible Web Components
Page 103: Building Accessible Web Components
Page 104: Building Accessible Web Components

Possible values

Page 105: Building Accessible Web Components

There are three possible values for aria-live: “off”, “polite” and

“assertive”.

Page 106: Building Accessible Web Components

<div  aria-­‐live="off">  

</div>

Page 107: Building Accessible Web Components

Assistive Technologies should not announce updates unless

the assistive technology is currently focused on that region.

Page 108: Building Accessible Web Components

Should be used for information that is not critical for users to

know about immediately.

Page 109: Building Accessible Web Components

<div  aria-­‐live="polite">  

</div>

Page 110: Building Accessible Web Components

Assistive Technologies should announce updates at the next graceful opportunity (e.g. end

of current sentence).

Page 111: Building Accessible Web Components

Should be used for warning notifications that users may

need to know.

Page 112: Building Accessible Web Components

<div  aria-­‐live="assertive">  

</div>  

Page 113: Building Accessible Web Components

Assistive Technologies should announce updates

immediately.

Page 114: Building Accessible Web Components

Should only be used if the interruption is imperative for users to know immediately

such as error alerts.

Page 115: Building Accessible Web Components

Unfortunately, aria-live=“assertive” is not well

supported at this point, so the “polite” value may be preferred.

http://maxdesign.com.au/jobs/sample-accessibility/10-notifications/index.html

Page 116: Building Accessible Web Components

aria-relevant

Page 117: Building Accessible Web Components

aria-relevant This attribute gives a hint about

what types of changes are relevant and should be announced by Assistive

Technologies.

Page 118: Building Accessible Web Components

<!-­‐-­‐  Insertion  of  nodes  into  the  live  region  should  be  considered  relevant  -­‐-­‐>  <div  aria-­‐relevant="additions">  </div>  

Page 119: Building Accessible Web Components

<!-­‐-­‐  Deletion  of  nodes  should  be  considered  relevant    -­‐-­‐>  <div  aria-­‐relevant="removals">  </div>  

Page 120: Building Accessible Web Components

<!-­‐-­‐  Changes  to  the  textual  content  of  existing  nodes  should  be  considered  relevant  -­‐-­‐>  <div  aria-­‐relevant="text">  </div>  

Page 121: Building Accessible Web Components

<!-­‐-­‐  All  changed  nodes  should  be  considered  relevant  -­‐-­‐>  <div  aria-­‐relevant="all">  </div>  

Page 122: Building Accessible Web Components

The default behaviour is equivalent to “additions text”.

Page 123: Building Accessible Web Components

aria-relevant values of “removals” or “all” should be

used sparingly.

Page 124: Building Accessible Web Components

role=alert

Page 125: Building Accessible Web Components

role=“alert” Defines a message with important information.

Page 126: Building Accessible Web Components

<div  role="alert">  

</div>  

Page 127: Building Accessible Web Components

Elements with the role=“alert” have an implicit aria-live value

of “assertive”.

Page 128: Building Accessible Web Components

PART 5

Error messages

Page 129: Building Accessible Web Components

We’re going to look at two different aspects of client-side

form validation.

Page 130: Building Accessible Web Components

1. Form control validation Individual form fields are

validated as the user moves focus out of the form control.

Page 131: Building Accessible Web Components

2. On-submit form validation The entire form is validated as

the user submits the form - before the script sends the form

to the server.

Page 132: Building Accessible Web Components

The problem

Page 133: Building Accessible Web Components

Problem 1: Form Control Error messages

only appears after a control has lost focus. For this reason, it is not immediately presented to

screen reader users.

Page 134: Building Accessible Web Components

Screen reader users often have to travel back through the form

to try and find invalid form controls. If invalid form controls are not effectively flagged, users may not be able to find them.

Page 135: Building Accessible Web Components

Problem 2: Screen reader users are often not informed that the overall

form contains errors.

Page 136: Building Accessible Web Components

In the worst cases, focus remains on the form submit

button, even after the form has been found to be invalid, and

screen reader users have no idea why the form won’t submit.

Page 137: Building Accessible Web Components

A solution for form control validation

Page 138: Building Accessible Web Components

1. When a form control is defined as invalid, the control and associated label should be “flagged” so that users can be made aware that there is an

error.

Page 139: Building Accessible Web Components

2. Flagging form controls and associated labels should not use colour alone to signify errors.

Page 140: Building Accessible Web Components

3. An error message should be displayed in close proximity to

the relevant form control.

Page 141: Building Accessible Web Components

Error: The phone number must include a 10 digit number

Phone

Page 142: Building Accessible Web Components

4. The error message should be informative - it should provide information that will help users

fill in the field correctly.

Page 143: Building Accessible Web Components

5. The error message should be programmatically associated

with the form control.

Page 144: Building Accessible Web Components

This means that the error message should be announced

along with the relevant label information.

Page 145: Building Accessible Web Components

There are a range of different methods to programmatically associate error messages with

form controls.

Page 146: Building Accessible Web Components

The simplest is to place the error message content inside

the label.

Page 147: Building Accessible Web Components

<div>     <label  for="email">       Email       <input  type="email"  id="email">       <span  class="error">Error</span>     </label>  </div>  

Page 148: Building Accessible Web Components

A solution for on-submit

form validation

Page 149: Building Accessible Web Components

If there are one or more form validation errors:

Page 150: Building Accessible Web Components

1. An error message should appear at the top of the form alerting users that there are

errors.

Page 151: Building Accessible Web Components

2. Focus must be taken to the error message as soon as the

user has attempted to submit for form.

Page 152: Building Accessible Web Components

3. The error message should list all errors.

Page 153: Building Accessible Web Components

4. Each error should ideally be a link that takes the user to the

relevant form control.

Page 154: Building Accessible Web Components

The form has two errors that must be completed before it can be submitted.

1. Error: You must include your first name2. Error: Email address must include an "@" symbol

Page 155: Building Accessible Web Components

Optionally, error messages can be placed inside a hide/show function that allows users to

choose whether they see the list of errors or not.

Page 156: Building Accessible Web Components

The form has two errors that must be completed before it can be submitted.

View all errors

Page 157: Building Accessible Web Components

Markup for error messages

Page 158: Building Accessible Web Components

The error message container can exist on the page, even when non-active. However, it should not contain any content until

triggered.

Page 159: Building Accessible Web Components

This container should be set with role=“alert”. This is used

to communicate important information.

Page 160: Building Accessible Web Components

<div       class="error-­‐message-­‐container"       role="alert">  

</div>

Page 161: Building Accessible Web Components

Optionally, the aria-live attribute can added with a value

of “assertive” or “polite”.

Page 162: Building Accessible Web Components

<div       class="error-­‐message-­‐container"       role="alert"     aria-­‐live="polite">  

</div>

Page 163: Building Accessible Web Components

This container can be set with tabindex value of “-1” so that it

will not receive focus.

Page 164: Building Accessible Web Components

<div       class="error-­‐message-­‐container"       role="alert"     aria-­‐live="polite"     tabindex="-­‐1">  

</div>

Page 165: Building Accessible Web Components

When the error message needs to be displayed (i.e. the user has

attempted to submit the form with invalid form controls) some

changes need to occur dynamically.

Page 166: Building Accessible Web Components

If present, the tabindex attribute value needs to be changed from “-1” to “0” so that the element will appear in normal tab order.

Page 167: Building Accessible Web Components

<div     class="error-­‐message-­‐container"     role="alert"     aria-­‐live="polite"     tabindex="0">  

</div>  

Page 168: Building Accessible Web Components

The container can be given a label so that it is announced to

screen reader users.

Page 169: Building Accessible Web Components

<div     class="error-­‐message-­‐container"     role="alert"     aria-­‐live="polite"     tabindex="0"     aria-­‐label="Form  Errors">  

</div>  

Page 170: Building Accessible Web Components

PART 6

Modals

Page 171: Building Accessible Web Components

The problem

Page 172: Building Accessible Web Components

Problem 1: Keyboard-only users are often

able to TAB outside of the modal window while the modal is still

active. This can be very confusing and disconcerting.

Page 173: Building Accessible Web Components

Problem 2: Screen reader users are

sometimes not informed that an action will trigger a modal.

Page 174: Building Accessible Web Components

Problem 3: Screen reader users are

sometimes not made aware of the purpose of the modal or what actions they need to perform within the modal.

Page 175: Building Accessible Web Components

Problem 4: Screen reader users are

sometimes sent to the top of the parent page after a modal

window has been closed. This can be confusing.

Page 176: Building Accessible Web Components

A solution

Page 177: Building Accessible Web Components

When a modal is not in use, we need to hide it so that is not

seen by sighted users or announced to Screen Readers.

Page 178: Building Accessible Web Components

<div     style="display:none">     ...  </div>  

Page 179: Building Accessible Web Components

When a modal window is triggered, we need to change

the value.

Page 180: Building Accessible Web Components

<div     style="display:block">     ...  </div>  

Page 181: Building Accessible Web Components

When the modal window becomes active, all other

content should be hidden from Assistive Technologies.

Page 182: Building Accessible Web Components

<!-­‐-­‐  all  other  content  -­‐-­‐>  <div     aria-­‐hidden="true">     ...  </div>  

<!-­‐-­‐  modal  window  -­‐-­‐>  <div     style="display:block">     ...  </div>  

Page 183: Building Accessible Web Components

We need to set the initial focus to the modal window element itself rather than elements inside

the modal.

Page 184: Building Accessible Web Components

Initial focus

Page 185: Building Accessible Web Components

Initial focus

Page 186: Building Accessible Web Components

This is important because we are going to give the modal a

label.

Page 187: Building Accessible Web Components

If we set focus on an element inside the window, the label will not be announced to

Assistive Technologies.

Page 188: Building Accessible Web Components

We need to inform screen reader users that this modal window is

a “modal dialog”.

Page 189: Building Accessible Web Components

<div     style="display:block"     role="dialog">     ...  </div>

Page 190: Building Accessible Web Components

We need to provide a label for the modal dialog, so Assistive Technologies can announce its

purpose.

Page 191: Building Accessible Web Components

<div     style="display:block"     role="dialog"     aria-­‐labelledby="modal-­‐label">  

  <h1  id="modal-­‐label">Choose  account</h1>  

</div>  

Page 192: Building Accessible Web Components

In some circumstances, we may need to provide a more

detailed description of the purpose of the modal dialog.

Page 193: Building Accessible Web Components

<div     style="display:block"     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>  

Page 194: Building Accessible Web Components

Keystrokes

Page 195: Building Accessible Web Components

TAB

Page 196: Building Accessible Web Components

TAB

Page 197: Building Accessible Web Components

TAB

Page 198: Building Accessible Web Components

TAB

Page 199: Building Accessible Web Components

TAB

Page 200: Building Accessible Web Components

TAB

Page 201: Building Accessible Web Components

TAB

Page 202: Building Accessible Web Components

TAB

Page 203: Building Accessible Web Components

SHIFT + TAB

Page 204: Building Accessible Web Components

SHIFT + TAB

Page 205: Building Accessible Web Components

SHIFT + TAB

Page 206: Building Accessible Web Components

SHIFT + TAB

Page 207: Building Accessible Web Components

SHIFT + TAB

Page 208: Building Accessible Web Components

SHIFT + TAB

Page 209: Building Accessible Web Components

SHIFT + TAB

Page 210: Building Accessible Web Components

ENTER

Page 211: Building Accessible Web Components

ENTER

Page 212: Building Accessible Web Components

SPACE

Page 213: Building Accessible Web Components

SPACE

Page 214: Building Accessible Web Components

TAB

Page 215: Building Accessible Web Components

ARROW

Page 216: Building Accessible Web Components

Option 1 - applesARROW

Page 217: Building Accessible Web Components

Option 2 - pearsARROW

Page 218: Building Accessible Web Components

Option 3 - bananasARROW

Page 219: Building Accessible Web Components

ESC

Page 220: Building Accessible Web Components

Adding meaning to important actions

Page 221: Building Accessible Web Components

For some important actions inside the modal window,

Assistive Technologies should be given additional

information to let them know what will happen.

Page 222: Building Accessible Web Components

As screen reader users are submitting form data, they

should be informed that:

Page 223: Building Accessible Web Components

1. They will be taken back to the parent page.

Page 224: Building Accessible Web Components

2. Where this data will be submitted when they return to

the parent page.

Page 225: Building Accessible Web Components

ENTER

“Submit and return to bank balance information. Your data will be added to the Balance table”

Page 226: Building Accessible Web Components

As screen reader users focus on the “Close” function, they should be informed that

closing will take them back to the parent page.

Page 227: Building Accessible Web Components

ENTER

“Leave form and return to bank balance information”

Page 228: Building Accessible Web Components

After modal dialog closes

Page 229: Building Accessible Web Components

When the modal window is closed, if users are being taken

back to the parent page:

Page 230: Building Accessible Web Components

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.

Page 231: Building Accessible Web Components

The user should not be thrown back to the top of the parent

page unless there is a good reason!

Page 232: Building Accessible Web Components

2. The user should be informed where they are and what change

has occurred.

Page 233: Building Accessible Web Components

ENTER

Page 234: Building Accessible Web Components

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”

Page 235: Building Accessible Web Components

PART 7

Where to start?

Page 236: Building Accessible Web Components

When is the best time to focus on

accessibility?

Page 237: Building Accessible Web Components

The best time to focus on accessibility is right at the beginning of development

process, when creating the individual components in your

pattern library.

Page 238: Building Accessible Web Components

Quick steps you can do yourself

Page 239: Building Accessible Web Components

Don’t be overwhelmed. Look for quick wins. You’ll be

surprised what you can do without too much effort.

Page 240: Building Accessible Web Components

Test with keyboard-only and make changes as needed. (Make sure you also check for visible focus).

1

Page 241: Building Accessible Web Components

/*  avoid  this!  */  :focus  {  outline:  none;  }

Page 242: Building Accessible Web Components

Test with accessibility checking tools and make changes as needed.2

Page 243: Building Accessible Web Components

Tenon https://tenon.io/

Web Accessibility Toolbar https://www.paciellogroup.com/resources/wat/

Accessibility Viewer https://www.paciellogroup.com/resources/aviewer

Colour Contrast Analyser https://www.paciellogroup.com/resources/contrastanalyser/

Page 244: Building Accessible Web Components

Accessibility Evaluation Toolbar 1.5.7.1.1 https://addons.mozilla.org/en-US/firefox/addon/accessibility-evaluation-

toolb/

WAVE http://wave.webaim.org/

Total Validator http://www.totalvalidator.com/

CynthisSays http://www.cynthiasays.com/

Page 245: Building Accessible Web Components

Test with one or more screen readers and make changes as needed.3

Page 246: Building Accessible Web Components

Win/IE11

Win/IE8

Win/Chrome

Win/Firefox

OSX/Chrome

OSX/Firefox

OSX/Safari

NVDA

PASS/FAIL

PASS/FAIL

PASS/FAIL

PASS/FAIL

-

-

-

JAWS

PASS/FAIL

PASS/FAIL

PASS/FAIL

PASS/FAIL

-

-

-

Voiceover

-

-

-

-

PASS/FAIL

PASS/FAIL

PASS/FAIL

Page 247: Building Accessible Web Components

Get expert assistance and conduct a formal accessibility audit of your website or web application and action as needed.

4

Page 248: Building Accessible Web Components

Russ Weakley Max Design

Site: maxdesign.com.auTwitter: twitter.com/russmaxdesignSlideshare: slideshare.net/maxdesignLinkedin: linkedin.com/in/russweakley

Page 249: Building Accessible Web Components

PART 1

Buttons vs links

https://www.flickr.com/photos/edanley/3246241416

Page 250: Building Accessible Web Components

The problem

Page 251: Building Accessible Web Components

Some developers use CSS button classes that allow them to make

any element appear like a button, even if it is a link.

Page 252: Building Accessible Web Components

This is a link

This is a button

Page 253: Building Accessible Web Components

<a  class="btn  btn-­‐default"  href="#"  role="button">     Button  using  a  link  </a>  

<button  class="btn  btn-­‐default"  type="button">     Button  using  a  button  </button>

Page 254: Building Accessible Web Components

The problem with this is that it can lead to some confusion

about when to use a link or a button.

Page 255: Building Accessible Web Components

When the incorrect element is used, this can confuse Assistive Technology users who expect links and buttons to behave in

specific ways.

Page 256: Building Accessible Web Components

The solution

Page 257: Building Accessible Web Components

Use a link when you want to send the user to a new

location - like a different page.

Page 258: Building Accessible Web Components

Use a button when you want the user to perform some sort of

action - like click a button, submit a form, open an

accordion.