дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 11:15:40 +02:00
fix(markdown): keep the preview-only scroll position across remounts (#1009)
Tab switches and mode toggles unmount MarkdownPreview, whose only scroll state was the DOM scrollTop; Preview Only started over at the top. Record the preview's own scrollTop in the per-path live markdown store and restore it on mount (split mode keeps its editor-driven sync).
Цей коміт міститься в:
1 джерело
8ca25e1984
коміт
bd2df0bd3a
4 files changed
+111
-3
No files matched your search
@@ -22,7 +22,7 @@ describe("selectable read-only surfaces", () => {
|
||||
it("Markdown preview (the reported case)", () => {
|
||||
act(() =>
|
||||
useLiveMarkdown.setState({
|
||||
"/p/README.md": { text: "# Title\n\nSome *text*", topLine: 0, scrollSeq: 0, fontZoom: 0 },
|
||||
"/p/README.md": { text: "# Title\n\nSome *text*", topLine: 0, scrollSeq: 0, fontZoom: 0, previewTop: 0 },
|
||||
}),
|
||||
);
|
||||
act(() => useMarkdownModes.setState((s) => ({ byPath: { ...s.byPath, "/p/README.md": "preview" } })));
|
||||
|
||||
Reference in new issue
Заблокувати користувача