Skip to content

Commit e185e20

Browse files
committed
🐛 Fix reload issue when switching from Output to Result tab
1 parent bc4664b commit e185e20

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/preview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ export const Preview: Component<Props> = (props) => {
192192

193193
onMount(() => {
194194
iframe.srcdoc = html;
195+
iframe.addEventListener('load', attachToIframe);
195196
});
196197

197198
return (
@@ -204,7 +205,6 @@ export const Preview: Component<Props> = (props) => {
204205
title="Solid REPL"
205206
class="overflow-auto p-2 w-full h-full dark:bg-other"
206207
ref={iframe}
207-
onLoad={attachToIframe}
208208
// @ts-ignore
209209
sandbox="allow-popups-to-escape-sandbox allow-scripts allow-popups allow-forms allow-pointer-lock allow-top-navigation allow-modals allow-same-origin"
210210
></iframe>

0 commit comments

Comments
 (0)