Fix checkbox component when rendering old values, fix form select rendering blank option

This commit is contained in:
Deon George 2024-08-17 10:36:07 +10:00
parent 83470c3ff5
commit ba18a2a21c
2 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,5 @@
<x-leenooks::form.base {{ $attributes }}>
<div class="form-check text-right">
<input type="checkbox" class="form-check-input {{ $class ?? ''}}@error($old ?? $name) is-invalid @enderror" id="{{ $id ?? $name }}" name="{{ $name }}" value="{{ old($old ?? $name,$value ?? '') }}" @checked(isset($checked)) @readonly(isset($readonly)) @required(isset($required)) @disabled(isset($disabled))>
<input type="checkbox" class="form-check-input {{ $class ?? ''}}@error($old ?? $name) is-invalid @enderror" id="{{ $id ?? $name }}" name="{{ $name }}" value="{{ old($old ?? $name,$value ?? '') }}" @checked(old($old ?? $name)) @readonly(isset($readonly)) @required(isset($required)) @disabled(isset($disabled))>
</div>
</x-leenooks::form.base>

View File

@ -1,7 +1,7 @@
<x-leenooks::form.base {{ $attributes }}>
<input type="hidden" id="{{ $name }}_disabled" name="{{ $name }}" value="" disabled>
<select class="form-control @error($old ?? $name) is-invalid @enderror" id="{{ $id ?? $name }}" name="{{ $name }}" @required(isset($required)) @disabled(isset($disabled))>
@if(! empty($value) || isset($addnew) || isset($choose))
@if(empty($value) || isset($addnew) || isset($choose))
<option value=""></option>
@isset($addnew)
<option value="new">{{ $addnew ?: 'Add New' }}</option>