From 9c3bc7bce9d9ce5062a1826b1851385ec021012b Mon Sep 17 00:00:00 2001 From: Randall Wilk Date: Mon, 22 Jan 2024 14:22:34 -0600 Subject: [PATCH] Hide copy to clipboard if input is disabled --- src/Actions/CopyToClipboardAction.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Actions/CopyToClipboardAction.php b/src/Actions/CopyToClipboardAction.php index dd03402..705f8f8 100644 --- a/src/Actions/CopyToClipboardAction.php +++ b/src/Actions/CopyToClipboardAction.php @@ -50,4 +50,15 @@ public static function getDefaultName(): ?string { return 'copyToClipboard'; } + + public function isHidden(): bool + { + $isHidden = parent::isHidden(); + + if ($isHidden) { + return true; + } + + return $this->getComponent()->isDisabled(); + } }