From d863d3e3c0b21ecaed2a999265b8437af0871e48 Mon Sep 17 00:00:00 2001 From: Divesh Dwivedi Date: Thu, 26 Oct 2023 12:37:02 +0000 Subject: [PATCH] fix: issues 107 x-form-select not hidding placeholder value --- resources/views/bootstrap-4/form-select.blade.php | 4 ++-- resources/views/bootstrap-5/form-select.blade.php | 2 +- src/Components/FormSelect.php | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/resources/views/bootstrap-4/form-select.blade.php b/resources/views/bootstrap-4/form-select.blade.php index 57206e1..9881cea 100644 --- a/resources/views/bootstrap-4/form-select.blade.php +++ b/resources/views/bootstrap-4/form-select.blade.php @@ -23,7 +23,7 @@ {!! $attributes->merge(['class' => 'form-control ' . ($hasError($name) ? 'is-invalid' : '')]) !!}> @if($placeholder) - @endif @@ -42,4 +42,4 @@ @if($hasErrorAndShow($name)) @endif - \ No newline at end of file + diff --git a/resources/views/bootstrap-5/form-select.blade.php b/resources/views/bootstrap-5/form-select.blade.php index 4c51724..f66be04 100644 --- a/resources/views/bootstrap-5/form-select.blade.php +++ b/resources/views/bootstrap-5/form-select.blade.php @@ -27,7 +27,7 @@ > @if($placeholder) - @endif diff --git a/src/Components/FormSelect.php b/src/Components/FormSelect.php index 12b0600..3d00bb3 100644 --- a/src/Components/FormSelect.php +++ b/src/Components/FormSelect.php @@ -18,6 +18,7 @@ class FormSelect extends Component public bool $multiple; public bool $floating; public string $placeholder; + public string $hidden; /** * Create a new component instance. @@ -34,6 +35,7 @@ public function __construct( bool $showErrors = true, bool $manyRelation = false, bool $floating = false, + bool $hidden = false, string $placeholder = '' ) { $this->name = $name; @@ -41,6 +43,7 @@ public function __construct( $this->options = $options; $this->manyRelation = $manyRelation; $this->placeholder = $placeholder; + $this->hidden = $hidden; if ($this->isNotWired()) { $inputName = static::convertBracketsToDots(Str::before($name, '[]'));