Skip to content

Commit 130d6ed

Browse files
committed
only scroll to leaves
1 parent 2c92f64 commit 130d6ed

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

packages/repl/src/lib/Output/AstNode.svelte

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,14 @@
4646
// if node contains the current selection, open
4747
if (start <= from && end >= to) {
4848
open = true;
49-
tick().then(() => {
50-
li.scrollIntoView();
51-
});
49+
50+
if (is_leaf) {
51+
tick().then(() => {
52+
li.scrollIntoView({
53+
block: 'center'
54+
});
55+
});
56+
}
5257
}
5358
});
5459
}

0 commit comments

Comments
 (0)