You've already forked joplin
							
							
				mirror of
				https://github.com/laurent22/joplin.git
				synced 2025-10-31 00:07:48 +02:00 
			
		
		
		
	This commit is contained in:
		| @@ -141,7 +141,11 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) { | ||||
| 						reg.logger().warn('CodeMirror: unsupported drop item: ', cmd); | ||||
| 					} | ||||
| 				} else if (cmd.name === 'editor.focus') { | ||||
| 					editorRef.current.focus(); | ||||
| 					if (props.visiblePanes.indexOf('editor') >= 0) { | ||||
| 						editorRef.current.focus(); | ||||
| 					} else { | ||||
| 						webviewRef.current.wrappedInstance.focus(); | ||||
| 					} | ||||
| 				} else { | ||||
| 					commandProcessed = false; | ||||
| 				} | ||||
| @@ -242,7 +246,7 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) { | ||||
| 				return commandOutput; | ||||
| 			}, | ||||
| 		}; | ||||
| 	}, [props.content, addListItem, wrapSelectionWithStrings, setEditorPercentScroll, setViewerPercentScroll, resetScroll, renderedBody]); | ||||
| 	}, [props.content, props.visiblePanes, addListItem, wrapSelectionWithStrings, setEditorPercentScroll, setViewerPercentScroll, resetScroll, renderedBody]); | ||||
|  | ||||
| 	const onEditorPaste = useCallback(async (event: any = null) => { | ||||
| 		const resourceMds = await handlePasteEvent(event); | ||||
|   | ||||
| @@ -114,6 +114,12 @@ class NoteTextViewerComponent extends React.Component<Props, any> { | ||||
| 		this.domReady_ = false; | ||||
| 	} | ||||
|  | ||||
| 	focus() { | ||||
| 		if (this.webviewRef_.current) { | ||||
| 			this.webviewRef_.current.focus(); | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	tryInit() { | ||||
| 		if (!this.initialized_ && this.webviewRef_.current) { | ||||
| 			this.initWebview(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user