Skip to content

Commit

Permalink
Use the GOV.UK shim-links-with-button-role.js script
Browse files Browse the repository at this point in the history
By default, this behaviour will only be applied to links with a role of button.
<a class="button" role="button">A button</a>

This script will allow them to be triggered with a space key after they’ve been focused, to match standard buttons.
  • Loading branch information
gemmaleigh committed Aug 19, 2016
1 parent e2ac841 commit 2a775df
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions public/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ $(document).ready(function() {
var $blockLabels = $(".block-label input[type='radio'], .block-label input[type='checkbox']");
new GOVUK.SelectionButtons($blockLabels);

// 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();

// Details/summary polyfill
// See /javascripts/vendor/details.polyfill.js

Expand Down

0 comments on commit 2a775df

Please sign in to comment.