Skip to content

Commit

Permalink
feat(#50): make accepted filtering keyboard accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianSolberg committed Oct 29, 2025
1 parent ed883b3 commit e6c6a30
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Accessibility/makeMenuTabbable.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export function makeMenuTabbable() {
makeMiniMapTabbable()
makePanelsTabbable()
makeElevationControlTabbable()
makeAcceptedFilteringTabbable()
}

/**
Expand Down Expand Up @@ -102,4 +103,20 @@ function makeElevationControlTabbable() {
}
});
});
}

/**
* Makes accepted filtering panel tabbable and keyboard clickable
*/
function makeAcceptedFilteringTabbable() {
const activateButton = document.getElementById('doAcceptedFiltering')
if (activateButton) {
activateButton.tabIndex = 0;
activateButton.addEventListener('keydown', (e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
activateButton.click();
}
});
}
}

0 comments on commit e6c6a30

Please sign in to comment.