Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change CSS for .jspsych-content to fix (RDK doesn't work with resize plugin) and other issues. #1536

Open
becky-gilbert opened this issue Feb 18, 2021 · 10 comments
Assignees
Labels
Milestone

Comments

@becky-gilbert
Copy link
Collaborator

See recent comments in #787.

@gorkemer
Copy link

gorkemer commented Feb 19, 2021

Hey everyone,

Hey @vijaymarupudi, thanks for chipping in! I'd also note that including canvas.style.position = 'block'; shifts the canvas slightly to the right, leaving empty (display_element) space at left border. I'm attaching a photo of that here. I changed the background color of the canvas to orange to see its size. That only resolved when canvas.style.position = 'absolute'; is put back in. However, as discussed, that adjustment disrupts the positioning of the canvas within the window after using the resize plugin. Would there be any other solutions to achieve an appropriate canvas display without tackling this slight-shift-to-the-right issue (with position = block) or a misaligned-canvas-size issue (with position=absolute)?

Görkem

1- canvas is shifted to the right with canvas.style.position = 'block';
canvasIsShiftedToRight

2- canvas origin (0,0) becomes the center of the window after full-screen, and resize plugins (and virtual-chin-rest)

2a- after fullscreen
Screen Shot 2021-02-18 at 8 08 32 PM

2b- after resize plugin
Screen Shot 2021-02-18 at 8 09 13 PM

@vijaymarupudi
Copy link
Contributor

Could you provide a branch with your examples, @gorkemer? I'd love to try to debug this issue.

@gorkemer
Copy link

gorkemer commented Feb 19, 2021

I created one here. That includes the experiment.html which I used for capturing the above photos. It allows for full-screen and resizing, and canvas position is set to block in the RDK plugin - canvas.style.position = 'block';

@becky-gilbert becky-gilbert added this to the 7.0 milestone Feb 22, 2021
@vijaymarupudi
Copy link
Contributor

It's canvas.style.display not canvas.style.positioning btw!

The problem is that .jspsych-content has a max width of 95%.

The comment (git blame: 6d3da21) says that it is an IE 10-11 fix, I'm not sure why exactly.

 .jspsych-content {
   max-width: 95%; /* this is mainly an IE 10-11 fix */
   text-align: center;
   margin: auto; /* this is for overflowing content */
 }

if you remove that and add display: block, it works well for me.

@vijaymarupudi
Copy link
Contributor

@gorkemer
Copy link

gorkemer commented Feb 24, 2021

Thanks for the troubleshooting @vijaymarupudi! I can confirm that this solved my issue. I think this issue should be noted inside the RDK plugin. Otherwise, when the RDK plugin is used with other JsPsych plugins, e.g. to produce a fixation cross, the center of that trial (e.g. fixation cross) and the center of the RDK is not aligned, e.g. fixation cross by the RDK shifts to the right.

@jodeleeuw
Copy link
Member

👍 We will find a general patch for this for 7.0.

@vijaymarupudi
Copy link
Contributor

No problem, glad to help :)

@becky-gilbert becky-gilbert added this to To do in 7.0 Feb 24, 2021
@becky-gilbert becky-gilbert self-assigned this Jun 9, 2021
@jodeleeuw jodeleeuw removed this from the 7.0 milestone Sep 10, 2021
@becky-gilbert becky-gilbert removed this from To do in 7.0 Sep 30, 2021
@jodeleeuw jodeleeuw changed the title RDK doesn't work with resize plugin Change CSS for .jspsych-content to fix (RDK doesn't work with resize plugin) and other issues. Oct 29, 2021
@jodeleeuw jodeleeuw added this to the 8.0 milestone Oct 29, 2021
@jodeleeuw
Copy link
Member

This will be a breaking change for existing experiments so I am adding this to 8.0

@jodeleeuw
Copy link
Member

See also #3056 for related issue with canvas plugins

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants