Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IfThenElse showing property behind "IF", even when condition is not true #4319

Open
4 tasks done
peterbartels opened this issue Sep 30, 2024 · 1 comment
Open
4 tasks done
Labels

Comments

@peterbartels
Copy link

peterbartels commented Sep 30, 2024

Prerequisites

What theme are you using?

core

Version

5.x

Current Behavior

When making a conditional property using the IfThenElse in an allOf and this property is not set (and also doesn;t validate the IF condition), it's still being shown.

In the minimal playground example, the "food" item is behind an if when animal: true - but the item is still shown when no animal is chosen by default

Expected Behavior

A property behind IF should not be shown by default

Steps To Reproduce

See this playground link

Environment

No response

Anything else?

No response

@peterbartels peterbartels added bug needs triage Initial label given, to be assigned correct labels and assigned labels Sep 30, 2024
@peterbartels peterbartels changed the title anyOf with IfThenElse showing property behind if IfThenElse showing property behind if when condition is not true Sep 30, 2024
@peterbartels peterbartels changed the title IfThenElse showing property behind if when condition is not true IfThenElse showing property behind "IF", even when condition is not true Sep 30, 2024
@nickgros
Copy link
Contributor

nickgros commented Oct 4, 2024

This is not a bug. The condition "required": [ "animal" ] needs to be in the if block if you want it to only be true when animal is not null.

Here is the changed schema in the playground.

@nickgros nickgros added question and removed bug needs triage Initial label given, to be assigned correct labels and assigned labels Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants