mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-26 12:27:06 +00: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:
		| @@ -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'); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 silverwind
					silverwind