Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

chore: Add autocomplete attribute to input fields

Andras Bacsai96b8ddf66474
diff --git a/app/View/Components/Forms/Input.php b/app/View/Components/Forms/Input.php
index 6c9378cacd..fbd7b0b158 100644
--- a/app/View/Components/Forms/Input.php
+++ b/app/View/Components/Forms/Input.php
@@ -22,6 +22,7 @@ class Input extends Component
public bool $allowToPeak = true,
public bool $isMultiline = false,
public string $defaultClass = 'input',
+ public string $autocomplete = 'off',
) {}
public function render(): View|Closure|string
diff --git a/resources/views/components/forms/input.blade.php b/resources/views/components/forms/input.blade.php
index 8ef0821656..fb206fac40 100644
--- a/resources/views/components/forms/input.blade.php
+++ b/resources/views/components/forms/input.blade.php
@@ -25,7 +25,8 @@
</svg>
</div>
@endif
- <input value="{{ $value }}" {{ $attributes->merge(['class' => $defaultClass]) }} @required($required)
+ <input autocomplete="{{ $autocomplete }}" value="{{ $value }}"
+ {{ $attributes->merge(['class' => $defaultClass]) }} @required($required)
@if ($id !== 'null') wire:model={{ $id }} @endif
wire:dirty.class.remove='dark:focus:ring-coolgray-300 dark:ring-coolgray-300'
wire:dirty.class="dark:focus:ring-warning dark:ring-warning" wire:loading.attr="disabled"
@@ -35,7 +36,7 @@
</div>
@else
- <input @if ($value) value="{{ $value }}" @endif
+ <input autocomplete="{{ $autocomplete }}" @if ($value) value="{{ $value }}" @endif
{{ $attributes->merge(['class' => $defaultClass]) }} @required($required) @readonly($readonly)
@if ($id !== 'null') wire:model={{ $id }} @endif
wire:dirty.class.remove='dark:focus:ring-coolgray-300 dark:ring-coolgray-300'