aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Crosby2012-08-30 22:17:44 -0700
committerPhil Crosby2012-08-30 22:17:44 -0700
commit666a2f3c091f0d9268a0883f17a46e565331fc12 (patch)
treed78a14188ff6f00717feb61fd01fbccd58e7fd2b
parent2ddbd58971bb07cc6cbde48e075b0f7aa10dcb03 (diff)
parent71b1ad14af2f9ae3a05ac5e1712de3d57147a57b (diff)
downloadvimium-666a2f3c091f0d9268a0883f17a46e565331fc12.tar.bz2
Merge pull request #629 from chelmertz/fix-next-find
Fix next find
-rw-r--r--content_scripts/vimium_frontend.coffee6
1 files changed, 4 insertions, 2 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee
index 5b7a7402..75092f79 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -660,7 +660,8 @@ selectFoundInputElement = ->
# instead. however, since the last focused element might not be the one currently pointed to by find (e.g.
# the current one might be disabled and therefore unable to receive focus), we use the approximate
# heuristic of checking that the last anchor node is an ancestor of our element.
- if (findModeQueryHasResults && DomUtils.isSelectable(document.activeElement) &&
+ if (findModeQueryHasResults && document.activeElement &&
+ DomUtils.isSelectable(document.activeElement) &&
isDOMDescendant(findModeAnchorNode, document.activeElement))
DomUtils.simulateSelect(document.activeElement)
# the element has already received focus via find(), so invoke insert mode manually
@@ -698,7 +699,8 @@ findAndFocus = (backwards) ->
# if we have found an input element via 'n', pressing <esc> immediately afterwards sends us into insert
# mode
- elementCanTakeInput = DomUtils.isSelectable(document.activeElement) &&
+ elementCanTakeInput = document.activeElement &&
+ DomUtils.isSelectable(document.activeElement) &&
isDOMDescendant(findModeAnchorNode, document.activeElement)
if (elementCanTakeInput)
handlerStack.push({