Focus back to the editor from anywhere
See original GitHub issueI’m having a modal that, on a given callback, gives me an URL.
I tried to embed the URL as insertImage
using window.pell.exec('insertImage', completeURL);
in my code, but after the modal appeared, I lost the focus on the editor.
How can I get the focus back ?
Note: I saw someone else having a similar problem (#83), and his closing answer was that he was losing focus. Since he closed it, I assume he managed to get back the right focus on the editor.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
How to gain "keyboard focus" back to Ace editor?
I need to click somewhere with mouse to get the normal cursor back: vim_after_clicking.png. Without key-bindings. Right after dismissing the ...
Read more >Visual Studio: set focus to text editor - keyboard shortcuts
A solution for returning to the text-editor while Visual Studio has the focus is by using the hotkey Ctrl + Tab . Share....
Read more >Keyboard shortcut to jump back to editor pane from ...
I found the shortcut to jump to the editor from the project pane (cmd+down arrow), but this only works for opening a new...
Read more >Focus tracking - CKEditor 5 Documentation
Checking if the view document is focused Click the editable area of the editor and then click somewhere else — the isFocused property...
Read more >Focusing: focus/blur
That's when a user clicks somewhere else or presses Tab to go to the next form ... classList.add("error"); // ...and put the focus...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I used this function.
function focusEditor() { document.getElementsByClassName("pell-content")[0].focus(); }
+1 on preserving cursor position. I’m adding an auto-complete menu that’s triggered by certain chars (e.g @, or #). It inserts into the correct place but then resets the cursor to the start of the editor.