Enhance fields conditional logic #12565
jbarbosa13
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
At the moment, we are able to hide or show a certain field using conditional logic. We can't, however, change other admin properties conditionally.
Scenario:
A very useful scenario is changing the
readOnly
property conditionally. There are multiple questions about this in Discord (like this).Example: I have a checkbox field and a text field. I only want the text field to be editable if the checkbox is active.
Proposal:
Instead of just looking at the visibility of the fields (or just adding the feature to
readOnly
field), we could make the condition attribute even more generic to change conditionally any type of admin field.Option 1:
Keep the "global" condition, but return an object.
Option 2:
Make it field-by-field based.
We could use, as we do now:
Or add a function to determine its value:
Beta Was this translation helpful? Give feedback.
All reactions