Skip to content

Commit

Permalink
Merge pull request #3213 from jspsych/add-response-ends-trial-vs-circle
Browse files Browse the repository at this point in the history
Fix display clearing bug in visual search circle plugin version 1.2.0

(rebased-with-history from commit daea41b)
  • Loading branch information
jodeleeuw authored and bjoluc committed Jun 7, 2024
2 parents 7926236 + daea41b commit d431e03
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/clever-coats-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@jspsych/plugin-visual-search-circle": patch
---

Fix display clearing problem introduced with version 1.2.0
4 changes: 4 additions & 0 deletions packages/plugin-visual-search-circle/src/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ describe("visual-search-circle", () => {
await pressKey("a");
await expectFinished();

expect(displayElement.querySelectorAll("img").length).toBe(0);

expect(getData().values()[0].correct).toBe(true);
});

Expand Down Expand Up @@ -58,6 +60,8 @@ describe("visual-search-circle", () => {
jest.runAllTimers();
await expectFinished();

expect(displayElement.querySelectorAll("img").length).toBe(0);

expect(getData().values()[0].correct).toBe(true);
});
});
Expand Down
2 changes: 2 additions & 0 deletions packages/plugin-visual-search-circle/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ class VisualSearchCirclePlugin implements JsPsychPlugin<Info> {
};

const end_trial = () => {
display_element.innerHTML = "";

this.jsPsych.pluginAPI.clearAllTimeouts();
this.jsPsych.pluginAPI.cancelAllKeyboardResponses();

Expand Down

0 comments on commit d431e03

Please sign in to comment.