Skip to content

Commit

Permalink
#6877 - fix react css computing
Browse files Browse the repository at this point in the history
  • Loading branch information
novikov82 committed Sep 8, 2023
1 parent 2bd5e20 commit ca6bfe8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/react/element.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export class SurveyRowElement extends SurveyElementBase<any, any> {
private rootRef: React.RefObject<HTMLDivElement>;
constructor(props: any) {
super(props);
(this.element as Question).cssClasses;
}
protected getStateElement(): any {
return this.element;
Expand All @@ -31,6 +32,14 @@ export class SurveyRowElement extends SurveyElementBase<any, any> {
protected get css(): any {
return this.props.css;
}

public shouldComponentUpdate(nextProps: any, nextState: any): boolean {
if (!super.shouldComponentUpdate(nextProps, nextState)) return false;

(this.element as Question).cssClasses;
return true;
}

protected renderElement(): JSX.Element {
const element = this.element;
const innerElement = this.createElement(element, this.index);
Expand Down

0 comments on commit ca6bfe8

Please sign in to comment.