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

Implement keyboard events for links with a role of button #825

Closed
robinwhittleton opened this issue Aug 11, 2016 · 4 comments
Closed

Implement keyboard events for links with a role of button #825

robinwhittleton opened this issue Aug 11, 2016 · 4 comments

Comments

@robinwhittleton
Copy link
Contributor

govuk_frontend_toolkit 4.15.0 will include a shim for fixing keyboard events on links with a role of button. In the frontend meeting it was decided that we’d implement this in static initially to test, and then decide whether to migrate it over to govuk_template. @cfq also requested that this usage was recorded in analytics too so that we can see how many people this affects.

@gemmaleigh
Copy link
Contributor

For further context, here's the discussion on GOV.UK elements, which led to the creation of the shim to allow anchors with role="button" to be 'clicked' via the space key. (thanks to @paulmsmith).

@gemmaleigh
Copy link
Contributor

gemmaleigh commented Aug 11, 2016

The govuk_frontend_toolkit has now been updated to 4.16.1, so this work can go ahead.

@gemmaleigh
Copy link
Contributor

Here's how it's used in govuk_elements:

  // Use GOV.UK shim-links-with-button-role.js to trigger a link styled to look like a button,
  // with role="button" when the space key is pressed.
  GOVUK.shimLinksWithButtonRole.init()

@NickColley
Copy link
Contributor

Just realised that this should be 'keyDown' not 'keyUp' since the page currently scrolls and then follows the link..

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

No branches or pull requests

3 participants