You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While readOnly and hidden are able to react to other fields values through context, description and deprecated are static.
We often need to write description like:
description: `Case 1: description for case 1Case 2: description for case 2`
while case 1 only occurs if the data is in one state and case 2 in another, and so we'd rather just show the right description according to the current data. deprecated has the same issue, but worse, since even if we make the reason conditional, the
deprecated yellow text is always there.
What I'd like to have is this, just like on readOnly and hidden:
description: (context)=>context.parent.someField==='state1' ? 'description for case 1' : 'description for case 2'
deprecated: (context)=>context.parent.someField==='state1' ? {reason: 'some reason'} : undefined// (or false)
The text was updated successfully, but these errors were encountered:
fvieira
changed the title
Allow description as a function with context
Allow description and deprecated as a function with context
Jan 30, 2025
While
readOnly
andhidden
are able to react to other fields values throughcontext
,description
anddeprecated
are static.We often need to write description like:
while case 1 only occurs if the data is in one state and case 2 in another, and so we'd rather just show the right description according to the current data.
deprecated
has the same issue, but worse, since even if we make the reason conditional, thedeprecated yellow text is always there.
What I'd like to have is this, just like on
readOnly
andhidden
:The text was updated successfully, but these errors were encountered: