Skip to content

Commit d1b62a8

Browse files
committed
fix(minimap): offset not updated after document height change
1 parent 0230413 commit d1b62a8

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/stores/minimap/minimap-reducer.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ const updateDocumentState = (
99
) => {
1010
if (action.type === 'minimap/set-card-ranges') {
1111
state.ranges.cards = action.payload.ranges;
12+
const newDocumentHeight =
13+
state.scrollbar.totalDrawnHeight_cpx !== action.payload.height_cpx;
14+
if (newDocumentHeight) {
15+
state.scrollbar.scrollPosition_cpx = 0;
16+
}
1217
state.scrollbar.totalDrawnHeight_cpx = action.payload.height_cpx;
1318
deriveScrollPosition(state);
1419
} else if (action.type === 'minimap/set-active-node') {

0 commit comments

Comments
 (0)