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.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix: add min/max length to input/texarea
Andras Bacsaic21122714173
diff --git a/app/View/Components/Forms/Textarea.php b/app/View/Components/Forms/Textarea.phpindex 3f887877c2..6081c2a8ae 100644--- a/app/View/Components/Forms/Textarea.php+++ b/app/View/Components/Forms/Textarea.php@@ -30,7 +30,9 @@ class Textarea extends Componentpublic bool $realtimeValidation = false,public bool $allowToPeak = true,public string $defaultClass = 'input scrollbar font-mono',- public string $defaultClassInput = 'input'+ public string $defaultClassInput = 'input',+ public ?int $minlength = null,+ public ?int $maxlength = null,) {//}diff --git a/resources/views/components/forms/input.blade.php b/resources/views/components/forms/input.blade.phpindex fb206fac40..d832cb30de 100644--- a/resources/views/components/forms/input.blade.php+++ b/resources/views/components/forms/input.blade.php@@ -41,8 +41,9 @@@if ($id !== 'null') wire:model={{ $id }} @endifwire: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"- type="{{ $type }}" @disabled($disabled)- min="{{ $attributes->get('min') }}" max="{{ $attributes->get('max') }}"+ type="{{ $type }}" @disabled($disabled) min="{{ $attributes->get('min') }}"+ max="{{ $attributes->get('max') }}" minlength="{{ $attributes->get('minlength') }}"+ maxlength="{{ $attributes->get('maxlength') }}"@if ($id !== 'null') id={{ $id }} @endif name="{{ $name }}"placeholder="{{ $attributes->get('placeholder') }}">@endifdiff --git a/resources/views/components/forms/textarea.blade.php b/resources/views/components/forms/textarea.blade.phpindex 24226ecdb5..b3669e43d9 100644--- a/resources/views/components/forms/textarea.blade.php+++ b/resources/views/components/forms/textarea.blade.php@@ -51,8 +51,8 @@type="{{ $type }}" @readonly($readonly) @disabled($disabled) id="{{ $id }}"name="{{ $name }}" placeholder="{{ $attributes->get('placeholder') }}"aria-placeholder="{{ $attributes->get('placeholder') }}">- <textarea x-cloak x-show="type !== 'password'" placeholder="{{ $placeholder }}"- {{ $attributes->merge(['class' => $defaultClass]) }}+ <textarea minlength="{{ $minlength }}" maxlength="{{ $maxlength }}" x-cloak x-show="type !== 'password'"+ placeholder="{{ $placeholder }}" {{ $attributes->merge(['class' => $defaultClass]) }}@if ($realtimeValidation) wire:model.debounce.200ms="{{ $id }}"@elsewire:model={{ $value ?? $id }}@@ -62,7 +62,8 @@</div>@else- <textarea {{ $allowTab ? '@keydown.tab=handleKeydown' : '' }} placeholder="{{ $placeholder }}"+ <textarea minlength="{{ $minlength }}" maxlength="{{ $maxlength }}"+ {{ $allowTab ? '@keydown.tab=handleKeydown' : '' }} placeholder="{{ $placeholder }}"{{ !$spellcheck ? 'spellcheck=false' : '' }} {{ $attributes->merge(['class' => $defaultClass]) }}@if ($realtimeValidation) wire:model.debounce.200ms="{{ $id }}"@else