Live Preview: scroll jumps backwards near the end of a note when the Properties panel is taller than the window

Steps to reproduce

  1. Open the sandbox vault (command palette: “Open sandbox vault”).
  2. Create a note with enough properties that the expanded Properties panel is taller than the editor window (for example 40+ properties or a few long text values), followed by enough text to scroll through several screens.
  3. Open it in Live Preview with Properties expanded and scroll slowly down to the end of the note.

Did you follow the troubleshooting guide?

Y

Expected result

The note scrolls smoothly to the end.

Actual result

Close to the end, the scroll position repeatedly jumps back up by several hundred pixels. With Properties collapsed, or with a short Properties panel, it doesn’t happen.

Environment

[Output of the “Show debug info” command]

Additional information

The cause is in CodeMirror’s scroll anchoring: it treats the scroller’s scrollTop as a height in its height map and doesn’t account for content rendered above .cm-content inside .cm-scroller, like the Properties panel. Once that offset is larger than the editor height, the anchor lands past the end of the document and the correction scrolls backwards. It reproduces in plain CodeMirror (6.43.14) with a large padding-top on .cm-content. I’ve reported it upstream with a minimal reproduction: Making sure you're not a bot!. Posting here so the fix can be picked up in a future CodeMirror update.

1 Like