Skip to content

Commit

Permalink
fixed checkboxes adaptifity
Browse files Browse the repository at this point in the history
  • Loading branch information
novikov82 committed Aug 2, 2024
1 parent 496ad97 commit 076c578
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/defaultV2-theme/blocks/sd-question.scss
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
display: inline-block;
flex: 1;
margin-top: calc(0.25 * var(--sd-base-vertical-padding)) 0;
max-width: 100%;
}

.sd-element--with-frame > .sd-question__content--left {
Expand Down
4 changes: 3 additions & 1 deletion src/defaultV2-theme/blocks/sd-selectbase.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
.sd-selectbase--multi-column {
display: flex;
flex: 1 1 0px;
flex-wrap: nowrap;
overflow: auto;
}

.sd-selectbase__label {
Expand All @@ -37,7 +39,7 @@
display: block;
box-sizing: border-box;
flex: 1 1 0px;
min-width: 0;
max-width: 100%;
}

.sd-selectbase__column:not(:last-child) {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions visualRegressionTests/tests/defaultV2/responsiveness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,51 @@ frameworks.forEach(framework => {
});
});

test("Check multicolumn checkbox question doesn't fit width", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(1600, 1080);
await initSurvey(framework, {
showQuestionNumbers: "off",
"widthMode": "static",
"width": "60%",
questions: [
{
"type": "checkbox",
"name": "contract-type",
"title": "Type of contract ",
"choices": [
{
"value": "Item 1",
"text": "Permanent"
},
{
"value": "Item 2",
"text": "Fixed-Term"
},
{
"value": "Item 3",
"text": "All year round"
},
{
"value": "Item 4",
"text": "Term-time only"
},
{
"value": "Item 5",
"text": "Annualized"
}
],
"colCount": 5
}
]
});
await takeElementScreenshot("responsiveness-checkbox-col-count-5-wide.png", Selector(".sd-question"), t, comparer);
await t.resizeWindow(1000, 1080);
await resetFocusToBody();
await takeElementScreenshot("responsiveness-checkbox-col-count-5-small.png", Selector(".sd-question"), t, comparer);
});
});

test("Check image question", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(1920, 1080);
Expand Down

0 comments on commit 076c578

Please sign in to comment.