Prevent keyboard propagation out of context menus (#7437)
This commit is contained in:
parent
7dacaf7d06
commit
f3776f8944
1 changed files with 2 additions and 0 deletions
|
@ -188,6 +188,8 @@ export default class ContextMenu extends React.PureComponent<IProps, IState> {
|
||||||
// We now only handle closing the ContextMenu in this keyDown handler.
|
// We now only handle closing the ContextMenu in this keyDown handler.
|
||||||
// All of the item/option navigation is delegated to RovingTabIndex.
|
// All of the item/option navigation is delegated to RovingTabIndex.
|
||||||
private onKeyDown = (ev: React.KeyboardEvent) => {
|
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.
|
// 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.
|
// They are probably using props.focusLock along with this option as well.
|
||||||
if (!this.props.managed) {
|
if (!this.props.managed) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue