Disabling action realtime on state change

hey there. I have a custom action in edit resource page given below
 Actions\Action::make('someAction')
                    ->action(function () {
                    })
                    ->disabled(fn(?Model $record) => $record->isDirty())
                    ->outlined()
                    ->hidden(fn(?Model $record) => $record?->trashed()),

What i want, whenever record get dirty I want to disable it. But following code is not reflecting in realtime on state change. what can I do here?
Was this page helpful?