diff options
Diffstat (limited to 'vimiumFrontend.js')
| -rw-r--r-- | vimiumFrontend.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/vimiumFrontend.js b/vimiumFrontend.js index e3c0c7de..d3345053 100644 --- a/vimiumFrontend.js +++ b/vimiumFrontend.js @@ -289,9 +289,15 @@ function onBlurCapturePhase(event) { */ function isFocusable(element) { return isInputOrText(element) || element.tagName == "EMBED"; } +/* + * Input or text elements are considered focusable and able to receieve their own keyboard events, + * and will enter enter mode if focused. + * Note: we used to discriminate for text-only inputs, but this is not accurate since all input fields + * can be controlled via the keyboard, particuarlly SELECT combo boxes. + */ function isInputOrText(target) { - return ((target.tagName == "INPUT" && (target.type == "text" || target.type == "password")) || - target.tagName == "TEXTAREA"); + var focusableInputs = ["input", "textarea", "select", "button"]; + return focusableInputs.indexOf(target.tagName.toLowerCase()) >= 0; } function enterInsertMode() { |
