mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-27 12:53:57 +01:00
Focus editor on "Write" tab click (#26714)
Focus the editor when clicking the "Write" tab. Works for both Textarea and EasyMDE. Does for some reason not work without the `requestAnimationFrame`.
This commit is contained in:
parent
390ec619f3
commit
636b6eaf2a
1 changed files with 6 additions and 0 deletions
|
@ -135,6 +135,12 @@ class ComboMarkdownEditor {
|
|||
$panelPreviewer.attr('data-tab', `markdown-previewer-${elementIdCounter}`);
|
||||
elementIdCounter++;
|
||||
|
||||
$tabEditor[0].addEventListener('click', () => {
|
||||
requestAnimationFrame(() => {
|
||||
this.focus();
|
||||
});
|
||||
});
|
||||
|
||||
$tabs.tab();
|
||||
|
||||
this.previewUrl = $tabPreviewer.attr('data-preview-url');
|
||||
|
|
Loading…
Reference in a new issue