diff options
| author | Carl Helmertz | 2012-08-26 12:43:55 +0200 |
|---|---|---|
| committer | Carl Helmertz | 2012-08-26 12:56:53 +0200 |
| commit | 71b1ad14af2f9ae3a05ac5e1712de3d57147a57b (patch) | |
| tree | d78a14188ff6f00717feb61fd01fbccd58e7fd2b /content_scripts/vimium_frontend.coffee | |
| parent | b7d20cad6e854d03b1f10a6eb7c4e44cbb2437c3 (diff) | |
| download | vimium-71b1ad14af2f9ae3a05ac5e1712de3d57147a57b.tar.bz2 | |
frontend: Error when canceling ('esc') findMode
document.activeElement does not get set prior to
1 Entering find mode; and
2 Canceling ('esc') before being satisfied with keyword ('enter')
Signed-off-by: Carl Helmertz <helmertz@gmail.com>
Diffstat (limited to 'content_scripts/vimium_frontend.coffee')
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 4e804d82..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 |
