mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-11 18:24:43 +02:00
This commit is contained in:
parent
a4854fcde8
commit
f87ff54e3d
@ -70,8 +70,13 @@ export function useScrollHandler(editorRef: any, webviewRef: any, onScroll: Func
|
||||
|
||||
if (editorRef.current) {
|
||||
const percent = editorRef.current.getScrollPercent();
|
||||
|
||||
setViewerPercentScroll(percent);
|
||||
if (!isNaN(percent)) {
|
||||
// when switching to another note, the percent can sometimes be NaN
|
||||
// this is coming from `gui/NoteEditor/NoteBody/CodeMirror/utils/useScrollUtils.ts`
|
||||
// when CodeMirror returns scroll info with heigth == clientHeigth
|
||||
// https://github.com/laurent22/joplin/issues/4797
|
||||
setViewerPercentScroll(percent);
|
||||
}
|
||||
}
|
||||
}, [setViewerPercentScroll]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user