Skip to content

Commit

Permalink
Some fixes for livewire 3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
dtvmedia committed Mar 25, 2024
1 parent fe08875 commit 854e799
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/Livewire/FormView.php
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ protected function returnResponse()
*/
protected function registerSubmitValidationExceptionHandler(): void
{
// todo
Livewire::listen('failed-validation', function (Validator $validator) {
$this->submitValidationExceptionHandler($validator);
});
Expand Down
4 changes: 2 additions & 2 deletions src/config/livewire-forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Possible values: "bootstrap"
'theme' => 'bootstrap',

// Possible values: "debounce.<x>ms", "lazy", "defer"
'update_mode' => 'debounce.250ms',
// Possible values: "live.debounce.<x>ms", "lazy", "defer"
'update_mode' => 'live.debounce.250ms',

];
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<textarea name="{{ $input->getId() }}"
id="{{ $input->getId(true) }}_text"
class="d-none"
wire:model.defer="{{ $input->getViewId() }}"
wire:model="{{ $input->getViewId() }}"
>{!! $this->getRawValue($input->getId()) !!}</textarea>
@include('nodus.packages.livewire-forms::livewire.'.config('livewire-forms.theme').'.components.validation')
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class="btn-check"
name="start"
value="{{$key}}"
@if($input::supports('disabling') && $input->isDisabled()) disabled @endif
wire:model="{{ $input->getViewId() }}"
wire:model.{{config('livewire-forms.update_mode')}}="{{ $input->getViewId() }}"
autocomplete="off" >
{{$option['label']}}
</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<textarea name="{{ $input->getId() }}"
id="{{ $input->getId(true) }}_text"
class="d-none"
wire:model.defer="{{ $input->getViewId() }}"
wire:model="{{ $input->getViewId() }}"
>{!! $this->getRawValue($input->getId()) !!}</textarea>
@include('nodus.packages.livewire-forms::livewire.'.config('livewire-forms.theme').'.components.validation')
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class="form-control selectpicker @if(isset($errors) && $errors->hasAny($input->g
data-none-selected-text="{{ $input->getNoneSelectedText() }}"
data-none-results-text="{{ $input->getNoneResultsText() }}"
@if($input::supports('disabling') && $input->isDisabled()) disabled @endif
wire:model="{{ $input->getViewId() }}">
wire:model.{{config('livewire-forms.update_mode')}}="{{ $input->getViewId() }}">
@foreach($input->getOptions() as $key => $option)
<option value="{{ $key }}" data-icon="{{ $option['icon'] }}">{{ $option['label'] }}</option>
@endforeach
Expand Down

0 comments on commit 854e799

Please sign in to comment.