mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	fix focusing the text editor component after adding a link, closes #523
This commit is contained in:
		| @@ -94,15 +94,16 @@ $form.submit(() => { | ||||
|             $dialog.modal('hide'); | ||||
|  | ||||
|             const linkHref = '#' + notePath; | ||||
|             const editor = noteDetailText.getEditor(); | ||||
|  | ||||
|             if (hasSelection()) { | ||||
|                 const editor = noteDetailText.getEditor(); | ||||
|  | ||||
|                 editor.execute('link', linkHref); | ||||
|             } | ||||
|             else { | ||||
|                 linkService.addLinkToEditor(linkTitle, linkHref); | ||||
|             } | ||||
|  | ||||
|             editor.editing.view.focus(); | ||||
|         } | ||||
|         else if (linkType === 'selected-to-active') { | ||||
|             const prefix = $clonePrefix.val(); | ||||
| @@ -145,10 +146,6 @@ function linkTypeChanged() { | ||||
|  | ||||
| $linkTypes.change(linkTypeChanged); | ||||
|  | ||||
| // return back focus to note text detail after quitting add link | ||||
| // the problem is that cursor position is reset | ||||
| $dialog.on("hidden.bs.modal", () => noteDetailText.focus()); | ||||
|  | ||||
| export default { | ||||
|     showDialog, | ||||
|     showDialogForClone | ||||
|   | ||||
		Reference in New Issue
	
	Block a user