Getting weather a field is disabled or not

I have a simple question: how can I access whether a field is disabled or not. I need this information inside a callback function.
4 Replies
King Dice
King DiceOP5mo ago
for context I need this information to conditionally show a hint explaining why a field is disabled
awcodes
awcodes5mo ago
$component->isDisabled() Components are injectable is callbacks for the various methods on the component itself. But difficult to give more advice with out see the code you’re tried.
King Dice
King DiceOP5mo ago
@awcodes with the following code:
->hint(fn (Component $component) => $component->isDisabled() ? "You can't change type if the institution has sessions" : null)
->hint(fn (Component $component) => $component->isDisabled() ? "You can't change type if the institution has sessions" : null)
I got this error
No description
King Dice
King DiceOP5mo ago
nevermind, I imported the wrong Component
Want results from more Discord servers?
Add your server