mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 21:24:59 +08:00
don't consume all keys
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
29b59dde5b
commit
bfb5706b4a
@ -183,6 +183,8 @@ export class ContextMenu extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
_onKeyDown = (ev) => {
|
_onKeyDown = (ev) => {
|
||||||
|
let handled = true;
|
||||||
|
|
||||||
switch (ev.key) {
|
switch (ev.key) {
|
||||||
case Key.TAB:
|
case Key.TAB:
|
||||||
case Key.ESCAPE:
|
case Key.ESCAPE:
|
||||||
@ -200,11 +202,15 @@ export class ContextMenu extends React.Component {
|
|||||||
case Key.END:
|
case Key.END:
|
||||||
this._onMoveFocusHomeEnd(this.state.contextMenuElem, false);
|
this._onMoveFocusHomeEnd(this.state.contextMenuElem, false);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
handled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (handled) {
|
||||||
// consume all other keys in context menu
|
// consume all other keys in context menu
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
renderMenu(hasBackground=this.props.hasBackground) {
|
renderMenu(hasBackground=this.props.hasBackground) {
|
||||||
|
Loading…
Reference in New Issue
Block a user