-
-
Notifications
You must be signed in to change notification settings - Fork 687
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
Add button_layout
parameter to support CSS grid
#3152
Conversation
🦋 Changeset detectedLatest commit: 45e0d65 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
(I'll update the tests if the general approach seems right) |
Agh, sorry Josh - for some reason I'm not receiving the jspsych/core notifications so I missed your question about this on #2858. This is actually my preferred solution. I think this will cover the most non-standard-layout use cases. If anyone is doing something really specific/unusual with the layout, we can point them in the direction of overriding the CSS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pending changes to failing tests 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very useful in general 👌
@bjoluc the failing tests are because of EDIT: clarification that this is when I try to update the snapshots using |
Nope, Jest tries to find the right position to update each inline snapshot at and doesn't succeed for some reason (Surcrase sourcemap issues?). I was erroneously hoping this would be fixed in a feature version without me looking into it. We have two options: Use regular snapshots (the ones with external files) instead of inline snapshots, or update the snapshots manually for the time being. I didn't completely give up on this and I'm planning to look into it when I get a chance, so until now I've always just manually updated the inline snapshots according to failure messages. Feel free to decide for either approach. |
This PR is trying to resolve the button layout issue in #2858.
It adds a
button_layout
parameter to the html-button-response plugin, and two corresponding parameters forbutton_rows
andbutton_cols
.I think the grid layout is an improvement over the flex layout, so I also decided to make it the default. But flex is still supported.
If these changes look reasonable to @jspsych/core I'll update the other button plugins as well.