Skip to content

Commit

Permalink
Merge pull request #8830 from surveyjs/bug/8817-update-toc
Browse files Browse the repository at this point in the history
Fixed #8817 - A form page which is created from code does not appear in TOC
  • Loading branch information
andrewtelnov authored Sep 20, 2024
2 parents 4cbba56 + 42df746 commit c801242
Show file tree
Hide file tree
Showing 6 changed files with 1,251 additions and 1,198 deletions.
2 changes: 1 addition & 1 deletion packages/survey-core/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export class Base {
}
Base.currentDependencis = new Dependencies(updater, target, property);
}
private static collectDependency(target: Base, property: string): void {
protected static collectDependency(target: Base, property: string): void {
if (Base.currentDependencis === undefined) return;
Base.currentDependencis.addDependency(target, property);
}
Expand Down
4 changes: 4 additions & 0 deletions packages/survey-core/src/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ export class PageModel extends PanelModelBase implements IPage {
protected canShowTitle(): boolean {
return this.survey && (<any>this.survey).showPageTitles;
}
protected setTitleValue(val: string): void {
super.setTitleValue(val);
this.navigationLocStrChanged();
}
/**
* A caption displayed on a navigation button in the TOC or progress bar. Applies when [`showTOC`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#showTOC) is `true` or when the [progress bar is visible](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#showProgressBar), [`progressBarType`](https://surveyjs.io/form-library/documentation/surveymodel#progressBarType) is set to `"pages"`, and [`progressBarShowPageTitles`](https://surveyjs.io/form-library/documentation/surveymodel#progressBarShowPageTitles) is `true`.
*
Expand Down
1 change: 1 addition & 0 deletions packages/survey-core/src/panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,7 @@ export class PanelModelBase extends SurveyElement<Question>
* @see questions
*/
public get elements(): Array<IElement> {
Base.collectDependency(this, "elements");
return this.elementsValue;
}
public getElementsInDesign(includeHidden: boolean = false): Array<IElement> {
Expand Down
Loading

0 comments on commit c801242

Please sign in to comment.