From 4f04c3a91b951a557103e823e22739193ee8ad01 Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Thu, 16 Oct 2014 15:05:00 +0200 Subject: [PATCH] Fix for WYSIWYG editor on github (#114). For these editors the click does not reach the editable element, so that vimb does not switch to insert mode. But the textarea is focused when the click appears, so that we can pick up the click event and check if the focused element is editable. I hope this will not break other pages that heavily depend on JavaScript. --- src/main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.c b/src/main.c index f503889..3325072 100644 --- a/src/main.c +++ b/src/main.c @@ -1143,6 +1143,11 @@ static gboolean button_relase_cb(WebKitWebView *webview, GdkEventButton *event) * mode when the user clicks into a form field */ mode_enter('i'); propagate = true; + } else if (vb.mode->id == 'n' && dom_is_editable(dom_get_active_element(vb.gui.webview))) { + /* if the focus is on an editable element after the click - switch + * also to insert mode - this seems to work also for WYSIWYG editors */ + mode_enter('i'); + propagate = true; } g_object_unref(result); -- 2.20.1