Skip to content

Visualize Your Ideas With Code

fix(docs): support multiple fiddles (#572)

Jacob899f133dd663
diff --git a/packages/docs/src/components/Fiddle/SharedPlayer.ts b/packages/docs/src/components/Fiddle/SharedPlayer.ts
index b14429c2..0ece0da4 100644
--- a/packages/docs/src/components/Fiddle/SharedPlayer.ts
+++ b/packages/docs/src/components/Fiddle/SharedPlayer.ts
@@ -81,12 +81,6 @@ export function borrowPlayer(
PlayerInstance.playback.previousScene,
);
});
- PlayerInstance.onRecalculated.subscribe(() => {
- if (StageInstance.finalBuffer.parentElement !== CurrentParent) {
- CurrentParent?.append(StageInstance.finalBuffer);
- CurrentSetter(PlayerInstance);
- }
- });
// TODO Find a way to attach the logger only for DEV:
// ProjectInstance.logger.onLogged.subscribe(console.log);
@@ -99,6 +93,9 @@ export function borrowPlayer(
PlayerInstance.activate();
PlayerInstance.requestReset();
+
+ CurrentParent?.append(StageInstance.finalBuffer);
+ CurrentSetter(PlayerInstance);
return PlayerInstance;
}