Skip to content

Commit

Permalink
#6844 Incorrect question gap in detail form (#6940)
Browse files Browse the repository at this point in the history
Fixes #6844
  • Loading branch information
novikov82 committed Sep 12, 2023
1 parent a051f5c commit 3d1d912
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/question_matrixdropdownbase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2303,6 +2303,7 @@ export class QuestionMatrixDropdownModelBase extends QuestionMatrixBaseModel<Mat
if (this.isDesignMode) return this.detailPanel;
var panel = this.createNewDetailPanel();
panel.readOnly = this.isReadOnly;
panel.setSurveyImpl(row);
var json = this.detailPanel.toJSON();
new JsonObject().toObject(json, panel);
panel.renderWidth = "100%";
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions visualRegressionTests/tests/defaultV2/matrix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,33 @@ frameworks.forEach(framework => {
});
});

test("Matrix detail questions in one row", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(1920, 1080);
await initSurvey(framework, {
elements: [
{
type: "matrixdynamic",
name: "matrix",
rowCount: 2,
detailPanelMode: "underRow",
columns: [{ name: "col1" }],
detailElements: [{ type: "text", name: "q1" }, { type: "text", name: "q2", startWithNewLine: false }],
minWidth: "800px",
maxWidth: "800px",
width: "800px"
},
],
});
await t
.click(Selector("#show-detail").nth(0))
.click(Selector("body"), { offsetX: 5, offsetY: 5 });

const questionRoot = Selector(".sd-question");
await takeElementScreenshot("question-matrix-detail-one-row.png", questionRoot, t, comparer);
});
});

test("Matrix many columns", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(800, 600);
Expand Down

0 comments on commit 3d1d912

Please sign in to comment.