1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Mobile: Fixes #5949: Scroll selection into view in beta editor when window resizes (#6610)

This commit is contained in:
Henry Heino
2022-06-26 10:21:38 -07:00
committed by GitHub
parent 8f3fd0bf8b
commit c7e3245008
2 changed files with 13 additions and 2 deletions

View File

@@ -266,6 +266,11 @@ function NoteEditor(props: Props, ref: any) {
cm = codeMirrorBundle.initCodeMirror(parentElement, initialText, theme);
${setInitialSelectionJS}
// Fixes https://github.com/laurent22/joplin/issues/5949
window.onresize = () => {
cm.scrollSelectionIntoView();
};
} catch (e) {
window.ReactNativeWebView.postMessage("error:" + e.message + ": " + JSON.stringify(e))
} finally {