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
Stormageddon, Dark Lord of All
for context I need this information to conditionally show a hint explaining why a field is disabled
awcodes
awcodes7d 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.
Stormageddon, Dark Lord of All
@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
Stormageddon, Dark Lord of All
nevermind, I imported the wrong Component