Skip to content
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

#8124 Broken alignment on the Preview. #8145

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/defaultV2-theme/blocks/sd-row.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@
align-items: stretch;
}
}

.sd-panel.sd-panel--as-page {
&>.sd-panel__content>.sd-row--multiple {
margin-left: calcSize(-2);
width: calc(100% + var(--base-unit) * 2);
}
}
.sd-panel:not(.sd-panel--as-page) {
.sd-row--multiple {
row-gap: var(--sd-base-vertical-padding);
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions visualRegressionTests/tests/defaultV2/panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,70 @@ frameworks.forEach(framework => {
});
});

test("Check preview mode for multi-rows", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(1920, 1080);
await initSurvey(framework, {
"pages": [
{
"name": "page2",
"elements": [
{
"type": "text",
"name": "question5",
"title": "First name"
},
{
"type": "text",
"name": "question6",
"startWithNewLine": false,
"title": "Last name"
},
{
"type": "text",
"name": "question7",
"title": "Address"
},
{
type: "panel",
"name": "dd",
"elements": [
{
"type": "text",
"name": "question1",
"title": "First name"
},
{
"type": "text",
"name": "question2",
"startWithNewLine": false,
"title": "Last name"
},
{
"type": "text",
"name": "question3",
"title": "Address"
},
]
},
]
},
],
"showQuestionNumbers": "off",
"questionsOnPageMode": "singlePage",
"showPreviewBeforeComplete": "showAllQuestions",
"widthMode": "static",
"width": "800"
});
await ClientFunction(() => {
document.body.focus();
(<any>window).survey.showPreview();
})();
const panelRoot = Selector(".sd-panel--as-page");
await takeElementScreenshot("panel-preview-mode-multi.png", panelRoot, t, comparer);
});
});

test("Two panels - one row, small screen", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(722, 1000);
Expand Down