From 7177694419f79986140a81cc5d7d259741e2b848 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 30 Jan 2021 14:15:27 -0500 Subject: Fix the alt key opening the menu in KBM input fields on Firefox (#1332) --- ext/bg/js/settings/keyboard-mouse-input-field.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ext/bg/js') diff --git a/ext/bg/js/settings/keyboard-mouse-input-field.js b/ext/bg/js/settings/keyboard-mouse-input-field.js index 94709313..09477519 100644 --- a/ext/bg/js/settings/keyboard-mouse-input-field.js +++ b/ext/bg/js/settings/keyboard-mouse-input-field.js @@ -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)); -- cgit v1.2.3