Skip to content

Commit

Permalink
Hide regenerate action if input is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
rawilk committed Jan 22, 2024
1 parent 9c3bc7b commit 3e395fe
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Actions/RegeneratePasswordAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,16 @@ public function shouldNotifyOnSuccess(): bool
{
return $this->evaluate($this->notifyOnSuccess) ?? true;
}

public function isHidden(): bool
{
$isHidden = parent::isHidden();

if ($isHidden) {
return true;
}

return $this->getComponent()->isDisabled() ||
$this->getComponent()->isReadOnly();
}
}

0 comments on commit 3e395fe

Please sign in to comment.