Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve screen reader support, ARIA etc #104

Merged
merged 8 commits into from
Dec 19, 2016
Merged

Improve screen reader support, ARIA etc #104

merged 8 commits into from
Dec 19, 2016

Conversation

colinrotherham
Copy link
Contributor

The UK Home office (and Department for Work and Pensions) have been maintaining a fork of the old—abandoned—Twitter branch for a little while.

We're using the typeahead in a number of our services for searching for countries. We'd be interested in you pulling in our additional ARIA support for this fork.

It includes these changes:

  1. Add an id attribute to each suggestion item
  2. Add role="option" to each suggestion item
  3. Add role="listbox" to the suggestions wrapper
  4. Add role="combobox" to the main input field
  5. Update aria-activedescendant on the input each time a suggestion is arrow-keyed etc
  6. Add a instructional status message (role="status", aria-live set to polite)
  7. Update dependencies (tests all pass, PhantomJS now runs on macOS Sierra)

What do you think?

easternbloc and others added 8 commits April 14, 2016 17:37
Add new status class. This is used to assign aria attributes too and inform the user of dynamic element changes
Add aria to typeahead to enhance accessibility
This ensures we still work on older browsers.
Fixes result count in ARIA status message
Also fix broken promises tests
@colinrotherham
Copy link
Contributor Author

colinrotherham commented Nov 29, 2016

One note to add, due to grunt-sed needing grunt@~0.4, I've replaced it with grunt-replace.

This allowed me to upgrade the other dependencies (e.g. newer and better performing grunt-contrib-uglify) without being held back.

Copy link
Contributor

@jlbooker jlbooker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me, and thanks for the accessibility improvements!

@jlbooker jlbooker added this to the v1.1.0 milestone Nov 30, 2016
@jlbooker
Copy link
Contributor

@corejavascript/collaborators Can we get another review before we merge this?

@easternbloc
Copy link
Contributor

@colinrotherham
Copy link
Contributor Author

colinrotherham commented Nov 30, 2016

That's great, thanks.

Be wary about your other pull requests though, e.g. #54

An auto select feature may interrupt the "use up and down arrow keys to navigate" messaging we're now giving to screen readers. Pressing down may jump to the 2nd result, skipping the 1st one.

@jlbooker
Copy link
Contributor

@colinrotherham Thanks for the heads up on that. Perhaps we should add the auto-select feature as an option (not enabled by default), and make a note of the potential issue in the docs.

@jlbooker
Copy link
Contributor

Merging this, since we haven't heard from any other reviewers.

@jlbooker jlbooker merged commit 815ae42 into corejavascript:master Dec 19, 2016
@colinrotherham
Copy link
Contributor Author

Thanks @jlbooker

@A6Brgeuka
Copy link

A6Brgeuka commented Dec 21, 2016

Hey there, thanks for this feature
how can I hide this message, it breaks my design
I want to do it through config
image

@colinrotherham ^^

@colinrotherham
Copy link
Contributor Author

@A6Brgeuka That content is needed for screen readers. It announces that results are available, otherwise it's not obvious.

Use the .visuallyhidden class to hide it for sighted people?

Something like:

.visuallyhidden {
    position: absolute;
    overflow: hidden;
    clip: rect(0 0 0 0);
    height: 1px;
    width: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants