aboutsummaryrefslogtreecommitdiffstats
path: root/vimiumFrontend.js
diff options
context:
space:
mode:
authorPhil Crosby2010-01-17 18:38:52 -0800
committerPhil Crosby2010-01-17 18:38:52 -0800
commit73b742d6cca7ee6c2e5816995a0269f3d1dfc6f7 (patch)
tree1f398b3110337b03a1c2ffe8accd9b1cbb537eb7 /vimiumFrontend.js
parent9be4650438aee2f10ab95e080960ea1b413d3fec (diff)
downloadvimium-73b742d6cca7ee6c2e5816995a0269f3d1dfc6f7.tar.bz2
Check for "not null" instead of false (which incorrectly includes 0) when focusing an element. Fixes #63.
Diffstat (limited to 'vimiumFrontend.js')
-rw-r--r--vimiumFrontend.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/vimiumFrontend.js b/vimiumFrontend.js
index c9d5c86e..a81b69c7 100644
--- a/vimiumFrontend.js
+++ b/vimiumFrontend.js
@@ -157,7 +157,7 @@ function enterInsertModeIfElementIsFocused() {
// TODO(philc): Consider using document.activeElement here instead.
var focusNode = window.getSelection().focusNode;
var focusOffset = window.getSelection().focusOffset;
- if (focusNode && focusOffset && focusNode.children.length > focusOffset &&
+ if (focusNode && focusOffset != null && focusNode.children.length > focusOffset &&
isEditable(focusNode.children[focusOffset]))
enterInsertMode();
}