Skip to content

Commit

Permalink
Fixed surveyjs/survey-library#8797 - Advanced Header - The header hei…
Browse files Browse the repository at this point in the history
…ght is decreased on a mobile and a header image is undistinguishable (#5905)

* Fixed surveyjs/survey-library#8797 - Advanced Header - The header height is decreased on a mobile and a header image is undistinguishable

* Fixed tests

---------

Co-authored-by: tsv2013 <[email protected]>
  • Loading branch information
tsv2013 and tsv2013 authored Sep 19, 2024
1 parent 2ed2297 commit 5bbe9cf
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/survey-creator-core/src/components/tabs/header-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { assign } from "../../utils/utils";

export class HeaderModel extends Base implements IHeader {
height: number;
mobileHeight: number;
inheritWidthFrom: "survey" | "container";
textAreaWidth: number;
overlapEnabled: boolean;
Expand Down Expand Up @@ -176,6 +177,18 @@ Serializer.addClass(
}
}
},
{
type: "spinedit",
name: "mobileHeight",
visibleIf: (obj) => obj.headerView === "advanced",
default: 0,
onPropertyEditorUpdate: function (obj: any, editor: any) {
if (!!editor) {
editor.unit = "px";
editor.min = 0;
}
}
},
{
type: "buttongroup",
name: "inheritWidthFrom",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const themeModelProperties: ISurveyPropertiesDefinition = {
{ name: "surveyTitle" },
{ name: "surveyDescription" },
{ name: "height", tab: "layout" },
{ name: "mobileHeight", tab: "layout" },
{ name: "inheritWidthFrom", tab: "layout" },
{ name: "textAreaWidth", tab: "layout" },

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,7 @@ test("headerViewContainer init state", (): any => {
"descriptionPositionY": "bottom",
"textAreaWidth": 512,
"height": 256,
"mobileHeight": 0,
"headerDescription": {
"family": "Open Sans",
"size": 16,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5bbe9cf

Please sign in to comment.