Skip to content

Commit

Permalink
Merge pull request #8644 from surveyjs/bug/image-in-one-row
Browse files Browse the repository at this point in the history
Fix image question doesn't fill full space when located in one row with multiple elements
  • Loading branch information
andrewtelnov authored Aug 2, 2024
2 parents 4019e5b + 897f112 commit 6734c0b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/defaultV2-theme/blocks/sd-image.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@
.sd-image__no-image use {
fill: $foreground-light;
}
.sd-question--image {
width: 100%;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions visualRegressionTests/tests/defaultV2/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,25 @@ frameworks.forEach(framework => {
await takeElementScreenshot("image-not-load.png", questionRoot, t, comparer);
});
});
test("Check image question responsive width when image is located in row with multiple elements", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(800, 600);
await initSurvey(framework, {
"questions": [
{
"type": "text",
"name": "q1",
},
{
"type": "image",
"name": "q2",
"imageLink": "http://localhost:8080/testCafe/resources/small_Dashka.jpg",
"startWithNewLine": false
}
]
});
const questionRoot = Selector(".sd-row");
await takeElementScreenshot("image-in-row.png", questionRoot, t, comparer);
});
});
});

0 comments on commit 6734c0b

Please sign in to comment.