mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-06 08:25:19 +01:00
tune active param logic
This commit is contained in:
parent
75ccd98e18
commit
a6aa53fc9d
2 changed files with 12 additions and 8 deletions
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -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 => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue