Don't switch from command to input mode if page says so.
authorDaniel Carl <danielcarl@gmx.de>
Fri, 5 Dec 2014 09:28:15 +0000 (10:28 +0100)
committerDaniel Carl <danielcarl@gmx.de>
Fri, 5 Dec 2014 09:28:15 +0000 (10:28 +0100)
src/dom.c

index 561e3b8..d7bd80e 100644 (file)
--- a/src/dom.c
+++ b/src/dom.c
@@ -202,8 +202,11 @@ static gboolean element_is_visible(WebKitDOMDOMWindow* win, WebKitDOMElement* el
 
 static gboolean auto_insert(Element *element)
 {
-    /* don't change mode if we are in pass through mode */
-    if (vb.mode->id != 'p' && dom_is_editable(element)) {
+    /* Change only the mode if we are in normal mode - passthrough should not
+     * be disturbed by this and if the user iy typing into inputbox we don't
+     * want to remove the content and force a switch to input mode. And to
+     * switch to input mode when this is already active makes no sense. */
+    if (vb.mode->id == 'n' && dom_is_editable(element)) {
         mode_enter('i');
 
         return true;