diff --git a/src/app/components/param-field-line/param-field-line.component.ts b/src/app/components/param-field-line/param-field-line.component.ts index 1cb5750c7f0e1f33fa6b52b29a0a932d30f5d641..071aa1fd9f9f6a03e8b668b4708efe7529b800ed 100644 --- a/src/app/components/param-field-line/param-field-line.component.ts +++ b/src/app/components/param-field-line/param-field-line.component.ts @@ -256,10 +256,14 @@ export class ParamFieldLineComponent implements OnChanges { if (oldValueMode !== ParamValueMode.MINMAX && oldValueMode !== ParamValueMode.LISTE) { this.param.valueMode = ParamValueMode.MINMAX; // min/max par défaut } - if (this._paramValuesComponent) { - // re-open modal when clicking the "var" mode button again (PoLS) - this._paramValuesComponent.openDialog(); - } + + // let framework create ParamValuesComponent instance and open dialog + setTimeout(() => { + if (this._paramValuesComponent) { + // re-open modal when clicking the "var" mode button again (PoLS) + this._paramValuesComponent.openDialog(); + } + }, 100); break; case "cal": diff --git a/src/app/components/param-values/param-values.component.ts b/src/app/components/param-values/param-values.component.ts index 05738ddc4afd5e89d76122fe8d0e5a7af6b7bbee..eeb36a21d27a6d06cca3f76a449ee6976d181f00 100644 --- a/src/app/components/param-values/param-values.component.ts +++ b/src/app/components/param-values/param-values.component.ts @@ -76,14 +76,6 @@ export class ParamValuesComponent implements AfterViewInit, Observer { } public ngAfterViewInit() { - // open dialog when switching to this mode, but only the first time this component is built, - // otherwise switching back from another calc tab will trigger the dialog again - if (this.param.valueMode === ParamValueMode.MINMAX && this.param.minValue === undefined) { - // use Promise trick to introduce a pseudo-timeout and avoid ExpressionChangedAfterItHasBeenCheckedError - Promise.resolve().then(() => { - this.openDialog(); - }); - } // subscribe to parameter values change (through dialog actions) this.param.addObserver(this); }