diff options
| author | Stephen Blott | 2015-01-18 11:24:20 +0000 |
|---|---|---|
| committer | Stephen Blott | 2015-01-18 11:24:20 +0000 |
| commit | 0f2343dbc73b4bbca856b777b8a3c11b0cffd2cd (patch) | |
| tree | 26537b5df06912df407478bf7095f63c3b3f9454 | |
| parent | f484718185675bd80eb005f39dd7bdbbdfd497fa (diff) | |
| download | vimium-0f2343dbc73b4bbca856b777b8a3c11b0cffd2cd.tar.bz2 | |
Modes; fix simulateSelect for PostFindMode.
| -rw-r--r-- | lib/dom_utils.coffee | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/dom_utils.coffee b/lib/dom_utils.coffee index aee2f972..846ed142 100644 --- a/lib/dom_utils.coffee +++ b/lib/dom_utils.coffee @@ -176,6 +176,11 @@ DomUtils = element.selectionStart? and element.selectionEnd? and element.selectionStart != element.selectionEnd simulateSelect: (element) -> + # If element == document.activeElement, then we won't get a new focus event. So, we pretend (to any + # active modes which care, e.g. PostFindMode) that element has been clicked. + if element == document.activeElement and DomUtils.isEditable document.activeElement + handlerStack.bubbleEvent "click", target: element + element.focus() # When focusing a textbox, put the selection caret at the end of the textbox's contents. # For some HTML5 input types (eg. date) we can't position the caret, so we wrap this with a try. |
