mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
feat: should scroll to top after selecting another note, also fix #3023
This commit is contained in:
@@ -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 () {
|
||||||
|
|||||||
Reference in New Issue
Block a user