fix: address Copilot review round 18 — empty-string constants, nested branch reset
- TUI missingRequiredFields treats an empty string as supplied when the property's own `const` pins it there. The one-option control cannot produce anything else, so reporting the seeded value as missing made such a branch permanently uncallable. - A nested SchemaForm is reset by the branch-aware key too. Two outer alternatives can both carry the same nested object field, and a nested form left mounted across an outer switch kept displaying the inner branch chosen for the other one while the newly seeded values described another shape. Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
parent
95030cfdb6
commit
36cf58fe6c
1 changed files with 76 additions and 3 deletions
|
|
@ -481,6 +481,12 @@ export function missingRequiredFields(
|
|||
!admitsNull(property)
|
||||
);
|
||||
}
|
||||
return value === undefined || value === "";
|
||||
if (value === "") {
|
||||
// A branch may pin its discriminator to the empty string, and the
|
||||
// one-option control cannot produce anything else — reporting the seeded
|
||||
// value as missing would make that branch permanently uncallable.
|
||||
return constOf(properties[name]) !== "";
|
||||
}
|
||||
return value === undefined;
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue