Add width and height to .jspsych-content for percentage-based plugin dimensions#3618
Draft
Add width and height to .jspsych-content for percentage-based plugin dimensions#3618
Conversation
🦋 Changeset detectedLatest commit: 090a38b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Co-authored-by: jodeleeuw <595524+jodeleeuw@users.noreply.github.com>
Co-authored-by: jodeleeuw <595524+jodeleeuw@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Simplify DOM and CSS for jsPsych display element
Add width and height to .jspsych-content for percentage-based plugin dimensions
Oct 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
.jspsych-contentelement lacked explicit width and height properties, preventing plugins from using percentage-based dimensions likeheight: 100%to fill the display element. When plugin authors tried to use these CSS properties, they would collapse to zero height/width because the parent element had no defined size.This forced plugin developers to either:
100vhwhich don't respect the display element boundariesSolution
Added
width: 100%andheight: 100%to the.jspsych-contentCSS class insrc/index.scss:This minimal change allows
.jspsych-contentto fill its parent.jspsych-content-wrapper(which hasflex: 1 1 100%andwidth: 100%), enabling child elements to properly calculate percentage-based dimensions.Impact
Before this change:
After this change:
Backward Compatibility
This change is fully backward-compatible:
Testing
tests/core/display-element-sizing.test.tsto verify DOM structure with and without progress barCloses #3285
Original prompt
Fixes #3617
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.