As you can see, Schema 1 contains oneOf for Object 2 in visibleIf and is rendered without Object 2 and Schema 2 does not contain oneOf but Object 2 is rendered.
If you flip-flop in Schema 1 to e.g. Value 2 and back to Value 1, you are back at initial state but now Object 2 is visible.
This does not look like it is intended. I would create a PR but currently I do not know why there is different logic for oneOf and without oneOf because I thought this should be equivalent in my case.
It looks like the not visible element in the oneOf part triggers the setVisible method with false.
I have an object
Object 2
which only should be visible if:Field 1
is equal to valueValue 1
orField 2
is equal to value1
.Now, add some extra:
Field 2
is only visible ifField 1
is equal toValue 2
orValue 3
.This simply means that
Object 2
is mandatory forValue 1
and is optional forValue 2
andValue 3
, which can be toggled viaField 2
.Sounds too complicated...here is a stackblitz: https://stackblitz.com/edit/angular-ivy-ymrftk
As you can see,
Schema 1
containsoneOf
forObject 2
invisibleIf
and is rendered withoutObject 2
andSchema 2
does not containoneOf
butObject 2
is rendered. If you flip-flop inSchema 1
to e.g.Value 2
and back toValue 1
, you are back at initial state but nowObject 2
is visible.This does not look like it is intended. I would create a PR but currently I do not know why there is different logic for
oneOf
and withoutoneOf
because I thought this should be equivalent in my case. It looks like the not visible element in theoneOf
part triggers thesetVisible
method with false.