Fix the alt key opening the menu in KBM input fields on Firefox (#1332)

This commit is contained in:
toasted-nutbread 2021-01-30 14:15:27 -05:00 committed by GitHub
parent 0ba1427775
commit 7177694419
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,7 +46,8 @@ class KeyboardMouseInputField extends EventDispatcher {
this._keySupported = keySupported;
this.setInput(key, modifiers);
const events = [
[this._inputNode, 'keydown', this._onModifierKeyDown.bind(this), false]
[this._inputNode, 'keydown', this._onModifierKeyDown.bind(this), false],
[this._inputNode, 'keyup', this._onModifierKeyUp.bind(this), false]
];
if (mouseModifiersSupported && this._mouseButton !== null) {
events.push(
@ -152,6 +153,10 @@ class KeyboardMouseInputField extends EventDispatcher {
}
}
_onModifierKeyUp(e) {
e.preventDefault();
}
_onMouseButtonMouseDown(e) {
e.preventDefault();
this._addModifiers(DocumentUtil.getActiveButtons(e));