From 59928035b7fdc241c4e4c1e83ca9b8a7fe8118ad Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Thu, 22 Oct 2026 13:43:44 +0200 Subject: [PATCH] feat(forms): add copy button to password inputs by default --- app/View/Components/Forms/Input.php | 5 ++++- .../views/auth/confirm-password.blade.php | 2 +- resources/views/auth/login.blade.php | 4 ++-- resources/views/auth/register.blade.php | 4 ++-- resources/views/auth/reset-password.blade.php | 4 ++-- .../views/components/forms/input.blade.php | 5 ++++- .../livewire/force-password-reset.blade.php | 4 ++-- .../views/livewire/profile/index.blade.php | 6 +++--- .../PasswordVisibilityComponentTest.php | 21 +++++++++++++++++++ 9 files changed, 41 insertions(+), 14 deletions(-) diff --git a/app/View/Components/Forms/Input.php b/app/View/Components/Forms/Input.php index e94b181375..3824bfe46d 100644 --- a/app/View/Components/Forms/Input.php +++ b/app/View/Components/Forms/Input.php @@ -25,7 +25,7 @@ class Input extends Component public bool $readonly = false, public ?string $helper = null, public bool $allowToPeak = true, - public bool $copyable = false, + public ?bool $copyable = null, public bool $isMultiline = false, public string $defaultClass = 'input', public string $autocomplete = 'off', @@ -71,6 +71,9 @@ class Input extends Component if (is_null($this->name)) { $this->name = $this->modelBinding !== 'null' ? $this->modelBinding : (string) $this->id; } + // Password fields get a copy button unless the caller opts out (account password forms). + $this->copyable ??= $this->type === 'password'; + // Durable class (not type-attr based): Alpine may toggle type to "text" when revealing, // and settings-workspace CSS otherwise overrides utility padding-right. $hasPeek = $this->type === 'password' && $this->allowToPeak; diff --git a/resources/views/auth/confirm-password.blade.php b/resources/views/auth/confirm-password.blade.php index ee5cbb0858..757f5a01f9 100644 --- a/resources/views/auth/confirm-password.blade.php +++ b/resources/views/auth/confirm-password.blade.php @@ -22,7 +22,7 @@