Skip to content

Commit 2670765

Browse files
committed
fix: preserve scroll position on pinned md reload
Use _switchFile (cache-aware) instead of _sendContent for pinned reload so the doc cache preserves scroll position. _sendContent re-renders from scratch and resets scroll.
1 parent 39f2d29 commit 2670765

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/extensionsIntegrated/Phoenix-live-preview/MarkdownSync.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,10 +1025,10 @@ define(function (require, exports, module) {
10251025

10261026
/**
10271027
* Re-send the current document's content to the iframe without clearing cache.
1028-
* Used when pinned to refresh the preview without losing the cached DOM.
1028+
* Uses cache-aware switch to preserve scroll position.
10291029
*/
10301030
function resendContent() {
1031-
_sendContent();
1031+
_switchFile();
10321032
}
10331033

10341034
/**

0 commit comments

Comments
 (0)