Skip to content

Commit

Permalink
#6096 Multi-Select Matrix: Boolean question is not aligned within a c…
Browse files Browse the repository at this point in the history
…olumn (#6212)

* #6096 Multi-Select Matrix: Boolean question is not aligned within a column
Fixes #6096

* #6096 Multi-Select Matrix: Boolean question is not aligned within a column
Fixes #6096

* #6096 - markup update
  • Loading branch information
novikov82 committed May 18, 2023
1 parent d9bc961 commit 7dd9e55
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/defaultCss/defaultV2Css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export var defaultV2Css = {
},
boolean: {
mainRoot: "sd-element sd-question sd-row__question sd-question--boolean",
root: "sv_qcbc sv_qbln sd-scrollable-container",
root: "sv_qcbc sv_qbln sd-scrollable-container sd-boolean-root",
rootRadio: "sv_qcbc sv_qbln sd-scrollable-container sd-scrollable-container--compact",
item: "sd-boolean",
itemOnError: "sd-boolean--error",
Expand Down
5 changes: 5 additions & 0 deletions src/defaultV2-theme/blocks/sd-table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -346,3 +346,8 @@
padding-top: calcSize(1);
}
}
.sd-table__question-wrapper {
.sd-boolean-root {
margin: auto;
}
}
2 changes: 1 addition & 1 deletion tests/markup/snapshots/boolean-v2.snap.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="sd-scrollable-container sv_qbln sv_qcbc">
<div class="sd-boolean-root sd-scrollable-container sv_qbln sv_qcbc">
<label class="sd-boolean sd-boolean--allowhover sd-boolean--indeterminate">
<input aria-invalid="false" aria-label="Question title" aria-required="false" class="sd-boolean__control sd-visuallyhidden" id="testid0i" name="name" type="checkbox" value="">
<div class="sd-boolean__thumb-ghost">
Expand Down
2 changes: 1 addition & 1 deletion tests/markup/snapshots/boolean-value-v2.snap.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="sd-scrollable-container sv_qbln sv_qcbc">
<div class="sd-boolean-root sd-scrollable-container sv_qbln sv_qcbc">
<label class="sd-boolean sd-boolean--allowhover sd-boolean--checked">
<input aria-invalid="false" aria-label="Question title" aria-required="false" checked="" class="sd-boolean__control sd-visuallyhidden" id="testid0i" name="name" type="checkbox" value="true">
<div class="sd-boolean__thumb-ghost">
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions visualRegressionTests/tests/defaultV2/matrix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,4 +344,36 @@ frameworks.forEach(framework => {
});
});

test("Matrix with boolean column", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(1920, 1080);
await initSurvey(framework, {
"elements": [
{
"type": "matrixdropdown",
"name": "question1",
"columns": [
{
"name": "Column 1"
},
{
"name": "Column 3",
"title": "Column 2",
"cellType": "boolean"
}
],
"rows": [
"Row 1",
"Row 2"
]
}
],
"widthMode": "static",
"width": "1000"
});
const questionRoot = Selector(".sd-table");
await takeElementScreenshot("question-matrix-with-boolean-column.png", questionRoot, t, comparer);
});
});

});

0 comments on commit 7dd9e55

Please sign in to comment.