From a8e0798f94098a412dbb63486c7d38f8150428ba Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Fri, 14 Oct 2016 20:33:00 +0200 Subject: [PATCH] Fix frame text input being focused when entering Caret mode --- extension/lib/commands-frame.coffee | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/extension/lib/commands-frame.coffee b/extension/lib/commands-frame.coffee index e6d01e9..f2fdf0a 100644 --- a/extension/lib/commands-frame.coffee +++ b/extension/lib/commands-frame.coffee @@ -472,7 +472,14 @@ commands.element_text_select = ({vim, elementIndex, full, scroll = false}) -> range.setEndBefore(element) utils.clearSelectionDeep(vim.content) + + # Focus the window so that the selection does not appear greyed out. However, + # if a text input was previously focused in that window (frame), that will + # cause the text input to be re-focused, so make sure to blur the active + # element, so that the caret does not end up there. window.focus() + window.document.activeElement?.blur?() + selection.addRange(range) if full -- 2.39.3