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
  • Loading branch information
jodeleeuw authored Jan 14, 2024
2 parents e278bff + 7b79772 commit daea41b
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 @@ -27,6 +27,8 @@ describe("visual-search-circle", () => {
pressKey("a");
await expectFinished();

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

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

Expand Down Expand Up @@ -57,6 +59,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 daea41b

Please sign in to comment.