1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Electron: Fixes #847: Prevent view from scrolling to top when clicking checkbox and editor not visible

This commit is contained in:
Laurent Cozic 2018-10-04 17:56:39 +01:00
parent 0bd19c97eb
commit ed89f55bff

View File

@ -1366,7 +1366,11 @@ class NoteTextComponent extends React.Component {
}
if (visiblePanes.indexOf('editor') < 0) {
editorStyle.display = 'none';
// Note: Ideally we'd set the display to "none" to take the editor out
// of the DOM but if we do that, certain things won't work, in particular
// things related to scroll, which are based on the editor. See
// editorScrollTop_, restoreScrollTop_, etc.
editorStyle.width = 0;
viewerStyle.width = innerWidth;
}