Skip to content

Commit c6c9d53

Browse files
committed
ignore toggle events when AST output tab is hidden
1 parent 7599b8e commit c6c9d53

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@
8686
onmouseover={(e) => (e.stopPropagation(), onhover(value))}
8787
onmouseleave={() => onhover(null)}
8888
ontoggle={(e) => {
89+
// toggle events can fire even when the AST output tab is hidden
90+
if (!active) return;
91+
8992
if (e.currentTarget.open && value && typeof value.start === 'number') {
9093
workspace.highlight_range(value, true);
9194
}

0 commit comments

Comments
 (0)