From baf595f15f8b8b249011b801eda69dca6a002777 Mon Sep 17 00:00:00 2001 From: Gemma Leigh Date: Thu, 11 Aug 2016 15:56:52 +0100 Subject: [PATCH] Use the GOV.UK shim-links-with-button-role.js script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By default, this behaviour will only be applied to links with a role of button. A button This script will allow them to be triggered with a space key after they’ve been focused, to match standard buttons. --- app/assets/javascripts/application.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 33d64954c9..261c58a70a 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -105,6 +105,10 @@ $(document).ready(function () { var $blockLabels = $(".block-label input[type='radio'], .block-label input[type='checkbox']") new GOVUK.SelectionButtons($blockLabels) // eslint-disable-line + // 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(); + // Show and hide toggled content // Where .block-label uses the data-target attribute var toggleContent = new ShowHideContent()