nhsuk-frontend
nhsuk-frontend copied to clipboard
Add role=button spacebar activation and button debouncing JS
Description
Links which are styled to appear visually like buttons can cause problems for users who might expect the button-like element to be clickable with a spacebar since this is how actual buttons behave. This PR adds some JS brought over from govuk-frontend to shim this behaviour in on top - so that links that look like buttons now also behave like buttons.
I have also brought over the button debouncing functionality from govuk while I was here. Which fixes #796
Checklist
- [x] Tested against our testing policy (Resolution, Browser & Accessibility)
- [x] Follows our coding standards and style guide
- [x] CHANGELOG entry
@andymantell or @Fenwick17 would we want to write some tests for the JS here if we're going to merge into v6?
@andymantell Once theres some tests this could go into the version 6 release rather than version 7 I think
@Fenwick17 Agreed. It's on my radar - will put some in when I next get a moment.