Javascript and ARIA Flashcards
What are three ways to notify blind users that content has changed?
- load a new page (or re-load current page)
- send the focus to the new content
- use ARIA live announcements
True or False: when loading content via AJAX, you should send focus to the new content immediately.
False
You should add a 1-2 second delay before sending focus to ensure the DOM has finished loading the content.
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. tabindex=”-1”
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.
C. The element that triggers the focus change must include aria-haspopup=”true”.
True or False: The ARIA live region must be present on the page and must be empty before inserting the content to be announced.
True
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
B and C
B. Provide a warning when the time limit is about to expire
C. Provide an option to extend the session
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.
False
You should usually save the data, unless there are privacy or security reasons not to.
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 and B
A. Users may not have time to read content before it disappears
B. Users may lose their place on the page
What are the two biggest issues with using AJAX?
- Knowing when and how to notify screen reader users about the new content
- Focus management
How can you ensure that infinite scrolling doesn’t block access for keyboard users?
- make it the last item in the DOM
- only load new content on user request
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.
B. Placeholders for content that is still loading should inform users the content is being loaded.
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>
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>
Why is focus handling particularly difficult in React?
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.
What information does ARIA communicate to screen readers?
- labels or names for items
- roles
- states of dynamic/interactive components
- relationships between items
- live announcements in real-time that are passed on to screen readers
When should you use aria-labelledby
?
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