Javascript and ARIA Flashcards

1
Q

What are three ways to notify blind users that content has changed?

A
  1. load a new page (or re-load current page)
  2. send the focus to the new content
  3. use ARIA live announcements
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

True or False: when loading content via AJAX, you should send focus to the new content immediately.

A

False

You should add a 1-2 second delay before sending focus to ensure the DOM has finished loading the content.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

When moving focus to an element that is not focusable, it is important to include which one of the following attributes on the container:

A. tabindex=”-1”
B. tabindex=”0”
C. tabindex=”1”
D. aria-focus=”true”

A

A. tabindex=”-1”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which of the following is NOT a consideration when moving focus to new content:

A. The container on which focus is set must not be empty.
B. Focus should not move unexpectedly.
C. The element that triggers the focus change must include aria-haspopup=”true”.
D. Sending focus to AJAX content must be the last event.

A

C. The element that triggers the focus change must include aria-haspopup=”true”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

True or False: The ARIA live region must be present on the page and must be empty before inserting the content to be announced.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

If one of your pages employs a time-limit, which of the following are recommended?

A. Ensure the time limit is greater than four hours
B. Provide a warning when the time limit is about to expire
C. Provide an option to extend the session
D. A and B
E. B and C

A

B and C

B. Provide a warning when the time limit is about to expire
C. Provide an option to extend the session

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

True or false: When a user allows a session to time out, it is not necessary to save data because the user would have extended the session if they intended to continue.

A

False

You should usually save the data, unless there are privacy or security reasons not to.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Accessibility problems associated with automatically refreshing or reloading a page include:

A. Users may not have time to read content before it disappears
B. Users may lose their place on the page
C. Users may have a seizure
D. A and B
E. All of the above

A

A and B

A. Users may not have time to read content before it disappears
B. Users may lose their place on the page

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the two biggest issues with using AJAX?

A
  1. Knowing when and how to notify screen reader users about the new content
  2. Focus management
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How can you ensure that infinite scrolling doesn’t block access for keyboard users?

A
  • make it the last item in the DOM
  • only load new content on user request
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

While portions of a page are still loading (lazy loading):

A. Screen Readers should announce every time new content has loaded.
B. Placeholders for content that is still loading should inform users the content is being loaded.
C. Newly loaded content should receive screen reader focus.
D. None of the above; this technique should be avoided.

A

B. Placeholders for content that is still loading should inform users the content is being loaded.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Regarding single-page applications, which of the following statements is FALSE?

A. Screen reader users must be made aware of new content loaded on the page.
B. Focus management is often an essential part of making a single-page application accessible.
C. The <title> of a single-page application should not be updated when the user has selected a link that causes an AJAX event.
D. A user must be able to use the browser's back and forward functionality as would be expected in a non-single-page application.</title>

A

C. The <title> of a single-page application should not be updated when the user has selected a link that causes an AJAX event.</title>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Why is focus handling particularly difficult in React?

A

The React philosophy is that components shouldn’t know the implementation of other components, so accessing the DOM directly breaks the abstraction.

You get around this by using useRef, which stores a reference to the actual DOM element.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What information does ARIA communicate to screen readers?

A
  1. labels or names for items
  2. roles
  3. states of dynamic/interactive components
  4. relationships between items
  5. live announcements in real-time that are passed on to screen readers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

When should you use aria-labelledby?

A

to link the element with its label so that screen readers can associate the two programmatically in the way that sighted users associate the two visually

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What goes in aria-labelledby?

A

one or more ids of other elements (the ones that act as a label for the current one)

17
Q

What’s the difference between aria-labelledby and aria-describedby?

A

aria-labelledby should replace the original text of the element

aria-describedby should provide supplemental information

18
Q

When should you use aria-label?

A

When you need a label that’s only available to screen readers (it’s like alt text).

Beware that it will replace any text the element already has.

19
Q

What does ARIA stand for?

A

Accessible Rich Internet Applications

20
Q

What is an example of an ARIA property?

A. Role-menuitem
B. Aria-selected
C. Aria-labelledby
D. Aria-checked

A

C. Aria-labelledby

21
Q

Who are the primary users of ARIA?

A

screen readers

22
Q

Which ARIA roles automatically trigger application mode?

A

role=”“dialog””
role=”“alertdialog””
role=”tablist”

23
Q

What does role="presentation" do?

A

cancels the native role of the element and turns it into the equivalent of a <span> or <div>

24
Q

When should an aria-live region be added to the DOM?

A

an empty live region container should be added on page load

the accessibility api needs to register the region as existing before you add any content to it

25
Q

Describe the basic ARIA keyboard interaction pattern.

A

Tab to the widget; use arrow keys within it

26
Q

True or False: Assigning role=”application” to a region disables most screen reader keystrokes within the region to allow developers to create custom keystrokes.

A

True

27
Q

Which role should be assigned within an application region to give screen readers access to regular text in the region?

A. Presentation role
B. Main role
C. Note role
D. Document role

A

D. Document role

28
Q

What happens when you assign a custom role to an element that already has semantic meaning?

For example: <li role=”button”>

A

the custom role completely
overrides the native role

the example will be treated as a button and not a list item

29
Q

Define an ARIA alert role.

A

A type of live region with important, and usually time-sensitive, information.

  • assertive
  • should close automatically since they don’t take focus
  • use alertdialog if you want element to get focus
30
Q

Define an ARIA combobox role.

A

An input that controls another element, such as a listbox or grid, that can dynamically pop up to help the user set the value of the input.

  • the popup element associated with a combobox MUST have a role of listbox, tree, grid, or dialog