fix input

This commit is contained in:
Andras Bacsai 2023-05-05 10:13:43 +02:00
parent 539f82eb08
commit 7fcf75829a

View File

@ -1,13 +1,11 @@
@props([ @props([
'id' => null, 'id' => $attributes->has('id') || $attributes->has('label'),
'type' => 'text', 'type' => 'text',
'required' => $attributes->has('required'), 'required' => $attributes->has('required'),
'label' => null, 'label' => $attributes->has('label'),
'instantSave' => false, 'instantSave' => $attributes->has('instantSave'),
'disabled' => false, 'noLabel' => $attributes->has('noLabel'),
'hidden' => false, 'noDirty' => $attributes->has('noDirty'),
'noLabel' => false,
'noDirty' => false,
]) ])
<span @class([ <span @class([
@ -30,9 +28,9 @@
<textarea @if (!$noDirty) wire:dirty.class="text-black bg-amber-300" @endif {{ $attributes }} <textarea @if (!$noDirty) wire:dirty.class="text-black bg-amber-300" @endif {{ $attributes }}
required={{ $required }} type={{ $type }} id={{ $id }} wire:model.defer={{ $id }}></textarea> required={{ $required }} type={{ $type }} id={{ $id }} wire:model.defer={{ $id }}></textarea>
@else @else
<input {{ $attributes }} required={{ $required }} <input {{ $attributes }} @if ($required) required @endif
@if (!$noDirty) wire:dirty.class="text-black bg-amber-300" @endif @if (!$noDirty) wire:dirty.class="text-black bg-amber-300" @endif type={{ $type }}
type={{ $type }} id={{ $id }} id={{ $id }}
@if ($instantSave) wire:click='instantSave' wire:model.defer={{ $id }} @else wire:model.defer={{ $value ?? $id }} @endif /> @if ($instantSave) wire:click='instantSave' wire:model.defer={{ $id }} @else wire:model.defer={{ $value ?? $id }} @endif />
@endif @endif
@error($id) @error($id)