Skip to content

Commit

Permalink
#7356 Error message location
Browse files Browse the repository at this point in the history
Fixes #7356
  • Loading branch information
novikov82 committed Nov 16, 2023
1 parent 59e388c commit f81347c
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/defaultV2-theme/blocks/sd-element.scss
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@
padding-bottom: var(--sd-base-padding);
background: $question-background;
box-shadow: $shadow-small;
display: flex;
flex-direction: column;
}

//compact styles
Expand Down
5 changes: 4 additions & 1 deletion src/defaultV2-theme/blocks/sd-question.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
}

.sd-element--with-frame>.sd-question__erbox--below-question {
margin-top: var(--sd-base-padding);
margin-top: auto;
border-radius: 0 0 calcCornerRadius(1) calcCornerRadius(1);
}

Expand Down Expand Up @@ -80,6 +80,9 @@

&.sd-question--error-bottom {
padding-bottom: 0;
&>.sd-question__content {
margin-bottom: var(--sd-base-vertical-padding)
}
}

&>.sd-question__erbox--outside-question {
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions visualRegressionTests/tests/defaultV2/question.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,52 @@ frameworks.forEach(framework => {
});
});

test("Check question errors bottom one-row", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {

await t.resizeWindow(800, 800);
await initSurvey(framework, {
"pages": [
{
"name": "page1",
"elements": [
{
"type": "text",
"name": "question1"
},
{
"type": "text",
"name": "question2",
"startWithNewLine": false,
"isRequired": true
},
{
"type": "checkbox",
"name": "question3",
"choices": [
"Item 1",
"Item 2",
"Item 3"
]
},
{
"type": "text",
"name": "question4",
"startWithNewLine": false,
"isRequired": true
}
]
}
],
"questionErrorLocation": "bottom"
});
const pRoot = Selector(".sd-body");
await t.click(".sd-navigation__complete-btn");
await resetFocusToBody();
await takeElementScreenshot("question-with-error-below-one-line.png", pRoot, t, comparer);
});
});

test("Check title location Left", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {

Expand Down

0 comments on commit f81347c

Please sign in to comment.