Skip to content

Commit

Permalink
fix empty page for react
Browse files Browse the repository at this point in the history
  • Loading branch information
OlgaLarina committed Sep 5, 2023
1 parent 6405453 commit 5d9c81e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/react/reactSurvey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ export class Survey extends SurveyElementBase<any, any>
renderResult = this.renderCompletedBefore();
} else if (this.survey.state == "loading") {
renderResult = this.renderLoading();
} else if (this.survey.state == "empty") {
renderResult = this.renderEmptySurvey();
} else {
renderResult = this.renderSurvey();
}
Expand Down Expand Up @@ -166,10 +168,6 @@ export class Survey extends SurveyElementBase<any, any>
var pageId = this.survey.activePage ? this.survey.activePage.id : "";

let className = this.survey.bodyCss;
if (!activePage) {
className = this.css.bodyEmpty;
activePage = this.renderEmptySurvey();
}
const style: any = {};
if(!!this.survey.renderedWidth) {
style.maxWidth = this.survey.renderedWidth;
Expand Down Expand Up @@ -201,7 +199,7 @@ export class Survey extends SurveyElementBase<any, any>
);
}
protected renderEmptySurvey(): JSX.Element {
return <span>{this.survey.emptySurveyText}</span>;
return <div className={this.css.bodyEmpty}>{this.survey.emptySurveyText}</div>;
}
protected createSurvey(newProps: any) {
if (!newProps) newProps = {};
Expand Down

0 comments on commit 5d9c81e

Please sign in to comment.