Skip to content

Commit

Permalink
Work for surveyjs/survey-creator#5282 - If question width is small fo…
Browse files Browse the repository at this point in the history
…r text type then changing input type breaks adaptivity - update responsivity manager on model changed
  • Loading branch information
tsv2013 committed Mar 7, 2024
1 parent e63ca46 commit 42be1f2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/actions/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ export class Action extends BaseAction implements IAction, ILocalizableOwner {
return this._component;
}
public dispose(): void {
this.updateCallback = undefined;
this.action = undefined;
super.dispose();
if (this.popupModel) {
Expand Down
13 changes: 13 additions & 0 deletions src/react/components/action-bar/action-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@ export class SurveyActionBar extends SurveyElementBase<IActionBarProps, any> {
this.model.resetResponsivityManager();
}
}
componentDidUpdate(prevProps: IActionBarProps, prevState: any): void {
super.componentDidUpdate(prevProps, prevState);
if(prevProps.model == this.props.model) {
return;
}
if (!!this.model.hasActions) {
this.model.resetResponsivityManager();
const container: HTMLDivElement | null = this.rootRef.current;
if(!!container) {
this.model.initResponsivityManager(container, (callback) => { setTimeout(callback); });
}
}
}

protected getStateElement(): Base {
return this.model;
Expand Down

0 comments on commit 42be1f2

Please sign in to comment.