Skip to content

Commit 1307388

Browse files
authored
Fix live editor output (#314)
1 parent 31c0831 commit 1307388

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

ggsql-wasm/demo/src/quarto/main.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,12 @@ function gatherCells(): CellInfo[] {
100100
const visCandidates = outputDiv.querySelectorAll<HTMLElement>(
101101
'div[id^="vis-"]'
102102
);
103-
if (visCandidates.length > 0) {
104-
visContainer = visCandidates[0];
105-
visId = visContainer.id;
103+
const match = Array.from(visCandidates).find((el) =>
104+
/^vis-\d+$/.test(el.id)
105+
);
106+
if (match) {
107+
visContainer = match;
108+
visId = match.id;
106109
}
107110
}
108111

0 commit comments

Comments
 (0)