Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Prevent keyboard propagation out of context menus (#7437)
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy committed Dec 22, 2021
1 parent 7dacaf7 commit f3776f8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/structures/ContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ export default class ContextMenu extends React.PureComponent<IProps, IState> {
// We now only handle closing the ContextMenu in this keyDown handler.
// All of the item/option navigation is delegated to RovingTabIndex.
private onKeyDown = (ev: React.KeyboardEvent) => {
ev.stopPropagation(); // prevent keyboard propagating out of the context menu, we're focus-locked

// If someone is managing their own focus, we will only exit for them with Escape.
// They are probably using props.focusLock along with this option as well.
if (!this.props.managed) {
Expand Down

0 comments on commit f3776f8

Please sign in to comment.