diff --git a/web/app/cad/craft/wizard/components/form/Form.tsx b/web/app/cad/craft/wizard/components/form/Form.tsx index 2c92b087..c5450959 100644 --- a/web/app/cad/craft/wizard/components/form/Form.tsx +++ b/web/app/cad/craft/wizard/components/form/Form.tsx @@ -52,7 +52,10 @@ export function attachToForm(Control): any { const fullPath = [...formPath, name]; const fullPathFlatten = flattenPath(fullPath); - const onChange = value => formEdit.onChange(fullPath, value); + const onChange = value => { + formEdit.onChange(fullPath, value); + setActive(true); + } const setActive = (isActive) => formEdit.setActive(fullPathFlatten, isActive); const value = params[name]; diff --git a/web/app/cad/craft/wizard/wizardPlugin.ts b/web/app/cad/craft/wizard/wizardPlugin.ts index 45fa8c46..7756c3d2 100644 --- a/web/app/cad/craft/wizard/wizardPlugin.ts +++ b/web/app/cad/craft/wizard/wizardPlugin.ts @@ -91,16 +91,17 @@ export function activate(ctx: ApplicationContext) { disposerList = createFunctionList(); } - const newState: WizardState = {}; - - if (curr) { - const op = ctx.operationService.get(curr.type); - if (op.defaultActiveField) { - newState.activeParam = op.defaultActiveField; + if (curr !== null && old?.requestKey !== curr.requestKey) { + const newState: WizardState = {}; + if (curr) { + const op = ctx.operationService.get(curr.type); + if (op.defaultActiveField) { + newState.activeParam = op.defaultActiveField; + } } + state$.next(newState); } - state$.next(newState); }) const updateParams = mutator => workingRequest$.update((req: WorkingRequest) => produce(req, draft => {