aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamiro Araujo2016-11-09 13:23:48 -0300
committerRamiro Araujo2016-11-09 13:23:48 -0300
commitc5d6b80cb6eae99aed461e20c99a286eaf352a2a (patch)
treeda027d1d3d93ea4639d207f12c01b4b62353be76
parent84b3e7d65d6cd7391f5b00cb77398cb60fe245bb (diff)
downloadvimium-c5d6b80cb6eae99aed461e20c99a286eaf352a2a.tar.bz2
treat select element as an input, setting focus to it
-rw-r--r--content_scripts/link_hints.coffee2
-rw-r--r--tests/dom_tests/dom_tests.coffee5
2 files changed, 6 insertions, 1 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee
index 02b8d656..0014e20a 100644
--- a/content_scripts/link_hints.coffee
+++ b/content_scripts/link_hints.coffee
@@ -394,7 +394,7 @@ class LinkHintsMode
clickActivator = (modifiers) -> (link) -> DomUtils.simulateClick link, modifiers
linkActivator = @mode.linkActivator ? clickActivator @mode.clickModifiers
# TODO: Are there any other input elements which should not receive focus?
- if clickEl.nodeName.toLowerCase() == "input" and clickEl.type not in ["button", "submit"]
+ if clickEl.nodeName.toLowerCase() in ["input", "select"] and clickEl.type not in ["button", "submit"]
clickEl.focus()
linkActivator clickEl
diff --git a/tests/dom_tests/dom_tests.coffee b/tests/dom_tests/dom_tests.coffee
index eab47546..68611230 100644
--- a/tests/dom_tests/dom_tests.coffee
+++ b/tests/dom_tests/dom_tests.coffee
@@ -188,6 +188,11 @@ context "Test link hints for focusing input elements correctly",
testDiv.appendChild input
inputs.push input
+ # manually add the select element to test focus
+ input = document.createElement "select"
+ testDiv.appendChild input
+ inputs.push input
+
tearDown ->
document.getElementById("test-div").innerHTML = ""