Skip to content

Commit

Permalink
#6779 - matrix alt-rows
Browse files Browse the repository at this point in the history
  • Loading branch information
novikov82 committed Apr 4, 2024
1 parent bbf6023 commit d9ace2f
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/defaultV2-theme/blocks/sd-file.scss
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@
.sd-file--single-image {
height: calc(36 * #{$base-unit});

.sd-file__preview {
.sd-file__preview-item {
width: 100%;
margin: 0;
}
Expand Down
9 changes: 9 additions & 0 deletions src/defaultV2-theme/blocks/sd-table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,22 @@
&.sd-item--checked .sd-item__decorator {
background-color: $primary;
}
&.sd-item--readonly.sd-item--checked .sd-item__decorator {
background-color: $primary-foreground;
}
&.sd-item--preview.sd-item--preview .sd-item__decorator {
background-color: transparent;
}

&.sd-radio--checked .sd-radio__control:focus+.sd-radio__decorator:after {
background-color: $primary-foreground;
}
}
}

}


}
}

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.
37 changes: 37 additions & 0 deletions visualRegressionTests/tests/defaultV2/readonly-preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,43 @@ frameworks.forEach(framework => {
});
});

test("Matrix ReadOnly and Preview alt rows", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(800, 600);
await initSurvey(framework, {
showPreviewBeforeComplete: "showAnsweredQuestions",
showQuestionNumbers: "off",
questions: [
{
"type": "matrix",
"name": "question1",
"readOnly": true,
"alternateRows": true,
"defaultValue": {
"Row 1": "Column 1",
"Row 2": "Column 2"
},
"columns": [
"Column 1",
"Column 2",
"Column 3"
],
"rows": [
"Row 1",
"Row 2"
]
}
]
});

await takeElementScreenshot("readonly-matrix-single-alt-rows.png", Selector(".sd-question__content"), t, comparer);
await ClientFunction(() => {
(<any>window).survey.showPreview();
})();
await takeElementScreenshot("preview-matrix-single-alt-rows.png", Selector(".sd-question__content"), t, comparer);
});
});

test("File ReadOnly and Preview", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(800, 600);
Expand Down

0 comments on commit d9ace2f

Please sign in to comment.