Skip to content

Commit

Permalink
Merge pull request #5158 from alphagov/tabs-remove-up-down-keybinding
Browse files Browse the repository at this point in the history
Remove ↑ up and ↓ down arrow key bindings from tabs
  • Loading branch information
querkmachine authored Jul 26, 2024
2 parents 5bafe64 + c84c2c5 commit daf2a7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ We've made fixes to GOV.UK Frontend in the following pull requests:

- [#5046: Skip ‘empty’ tasks in the task list](https://github.com/alphagov/govuk-frontend/pull/5046)
- [#5066: Fix whitespace affecting text alignment in pagination block variant](https://github.com/alphagov/govuk-frontend/pull/5066)
- [#5158: Remove ↑ up and ↓ down arrow key bindings from tabs](https://github.com/alphagov/govuk-frontend/pull/5158)

## 5.4.1 (Fix release)

Expand Down
10 changes: 3 additions & 7 deletions packages/govuk-frontend/src/govuk/components/tabs/tabs.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -365,26 +365,22 @@ export class Tabs extends GOVUKFrontendComponent {
/**
* Handle tab keydown event
*
* - Press right/down arrow for next tab
* - Press left/up arrow for previous tab
* - Press right arrow for next tab
* - Press left arrow for previous tab
*
* @private
* @param {KeyboardEvent} event - Keydown event
*/
onTabKeydown(event) {
switch (event.key) {
// 'Left', 'Right', 'Up' and 'Down' required for Edge 16 support.
// 'Left' and 'Right' required for Edge 16 support.
case 'ArrowLeft':
case 'ArrowUp':
case 'Left':
case 'Up':
this.activatePreviousTab()
event.preventDefault()
break
case 'ArrowRight':
case 'ArrowDown':
case 'Right':
case 'Down':
this.activateNextTab()
event.preventDefault()
break
Expand Down

0 comments on commit daf2a7a

Please sign in to comment.