1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

feat: should scroll to top after selecting another note, also fix #3023

This commit is contained in:
hikerpig
2019-07-28 16:53:21 +08:00
committed by Junyoung Choi
parent 084decaa85
commit 25ef456af2

View File

@@ -591,6 +591,11 @@ export default class MarkdownPreview extends React.Component {
if (needsRewriteIframe) { if (needsRewriteIframe) {
this.rewriteIframe() this.rewriteIframe()
} }
// Should scroll to top after selecting another note
if (prevProps.noteKey !== this.props.noteKey) {
this.getWindow().scrollTo(0, 0)
}
} }
getStyleParams () { getStyleParams () {
@@ -962,8 +967,6 @@ export default class MarkdownPreview extends React.Component {
overlay.appendChild(zoomImg) overlay.appendChild(zoomImg)
document.body.appendChild(overlay) document.body.appendChild(overlay)
} }
this.getWindow().scrollTo(0, 0)
} }
focus () { focus () {