Skip to content

Commit 04b9bb2

Browse files
authored
fix: enable keyboard controls on menu items (#8777)
## Description This fix addresses an issue that was introduced in this [refactor](35de64c#diff-9fd94576fe3b609171a426feb961b0954d70c8c14e598024d49ae9c8836a71ca). At the moment, all key down events that are supposed to interact with the `menu-item` component are now being ignored, meaning you are unable to interact with most of the menu items in the control bar (e.g. captions settings). This PR fixes that by only ignoring key down events that are normally ignored by the `menu-item`. ## Requirements Checklist - [x] Feature implemented / Bug fixed - [ ] If necessary, more likely in a feature request than a bug fix - [ ] Change has been verified in an actual browser (Chrome, Firefox, IE) - [ ] Unit Tests updated or fixed - [ ] Docs/guides updated - [ ] Example created ([starter template on JSBin](https://codepen.io/gkatsev/pen/GwZegv?editors=1000#0)) - [ ] Has no DOM changes which impact accessiblilty or trigger warnings (e.g. Chrome issues tab) - [ ] Has no changes to JSDoc which cause `npm run docs:api` to error - [ ] Reviewed by Two Core Contributors
1 parent fa9c41c commit 04b9bb2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/js/menu/menu-item.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class MenuItem extends ClickableComponent {
9494
* @listens keydown
9595
*/
9696
handleKeyDown(event) {
97-
if (['Tab', 'Escape', 'ArrowUp', 'ArrowLeft', 'ArrowRight', 'ArrowDown'].includes(event.key)) {
97+
if (!['Tab', 'Escape', 'ArrowUp', 'ArrowLeft', 'ArrowRight', 'ArrowDown'].includes(event.key)) {
9898
// Pass keydown handling up for unused keys
9999
super.handleKeyDown(event);
100100
}

0 commit comments

Comments
 (0)