From 97f3270802aa0e6aed9a8c1bcd37cf9375acf484 Mon Sep 17 00:00:00 2001 From: Shaobin-Jiang Date: Sun, 17 Mar 2024 09:29:26 +0800 Subject: [PATCH 1/2] fix multiple jspsych instances running issue --- packages/jspsych/src/JsPsych.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/jspsych/src/JsPsych.ts b/packages/jspsych/src/JsPsych.ts index b1395318dd..54174fa51d 100644 --- a/packages/jspsych/src/JsPsych.ts +++ b/packages/jspsych/src/JsPsych.ts @@ -450,7 +450,7 @@ export class JsPsych { options.display_element.innerHTML = '
'; this.DOM_container = options.display_element; - this.DOM_target = document.querySelector("#jspsych-content"); + this.DOM_target = this.DOM_container.querySelector("#jspsych-content"); // set experiment_width if not null if (options.experiment_width !== null) { From f8ec77af20b563990900c9ab1bcd6004022c3cc7 Mon Sep 17 00:00:00 2001 From: Shaobin-Jiang Date: Sun, 17 Mar 2024 09:30:53 +0800 Subject: [PATCH 2/2] add changeset --- .changeset/loud-brooms-rush.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/loud-brooms-rush.md diff --git a/.changeset/loud-brooms-rush.md b/.changeset/loud-brooms-rush.md new file mode 100644 index 0000000000..82f8fe48f0 --- /dev/null +++ b/.changeset/loud-brooms-rush.md @@ -0,0 +1,5 @@ +--- +"jspsych": patch +--- + +Fix bug that multiple jspsych instances cannot be run simultaneously