aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormrmr19932015-02-19 14:45:47 +0000
committermrmr19932015-02-19 14:45:47 +0000
commit7a380f3f0db55aefadcf73cf41e942e44e22df79 (patch)
treeaba2ef5edc8f199d31cd139271797146e3eea071
parentdfc84985802529be1cc32552d7c8016bf2e56dad (diff)
downloadvimium-7a380f3f0db55aefadcf73cf41e942e44e22df79.tar.bz2
Stop trying to place the cursor at the end of an input on focus
-rw-r--r--content_scripts/vimium_frontend.coffee3
-rw-r--r--lib/dom_utils.coffee5
2 files changed, 1 insertions, 7 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee
index 609b6b40..f996f753 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -796,8 +796,7 @@ executeFind = (query, options) ->
# previous find landed in an editable element, then that element may still be activated. In this case, we
# don't want to leave it behind (see #1412).
if document.activeElement and DomUtils.isEditable document.activeElement
- if not DomUtils.isSelected document.activeElement
- document.activeElement.blur()
+ document.activeElement.blur() unless DomUtils.isSelected document.activeElement
# we need to save the anchor node here because <esc> seems to nullify it, regardless of whether we do
# preventDefault()
diff --git a/lib/dom_utils.coffee b/lib/dom_utils.coffee
index fae29e49..26e0e736 100644
--- a/lib/dom_utils.coffee
+++ b/lib/dom_utils.coffee
@@ -190,11 +190,6 @@ DomUtils =
handlerStack.bubbleEvent "click", target: element
else
element.focus()
- unless @isSelected element
- # When focusing a textbox (without an existing selection), put the selection caret at the end of the
- # textbox's contents. For some HTML5 input types (eg. date) we can't position the caret, so we wrap
- # this with a try.
- try element.setSelectionRange(element.value.length, element.value.length)
simulateClick: (element, modifiers) ->
modifiers ||= {}