This repository was archived by the owner on Mar 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed
Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ export default {
3131 _wireToggleMethod : '' ,
3232 _focusedOptionId : null ,
3333 _noCloseOnSelect : false , // flag we can set for certain actions that shouldn't close the menu
34+ _wireModelName : null ,
3435
3536 menu ( ) {
3637 if ( ! this . $refs . menu ) {
@@ -501,6 +502,13 @@ export default {
501502 this . handleValueChange ( ) ;
502503
503504 this . $dispatch ( 'input' , newValue ) ;
505+
506+ // For some reason when using a wire:model.defer, livewire is not
507+ // sending null values back to the server for updates, so we will
508+ // force it to here...
509+ if ( newValue === null && this . _wire && this . _wireModelName ) {
510+ this . _wire . set ( this . _wireModelName , null , true ) ;
511+ }
504512 } ) ;
505513 } ,
506514
Original file line number Diff line number Diff line change 55 @endif
66 @if ($hasWireModel () )
77 value: @entangle ($attributes -> wire (' model' ) ),
8+ @if ($attributes -> wire (' model' )-> hasModifier (' defer' ) )
9+ _wireModelName: '{{ $attributes -> wire (' model' )-> value () } } ',
10+ @endif
811 @elseif ($hasXModel () )
912 value: {{ $attributes -> first (' x-model' ) } } ,
1013 @else
Original file line number Diff line number Diff line change 55 @endif
66 @if ($hasWireModel () )
77 value: @entangle ($attributes -> wire (' model' ) ),
8+ @if ($attributes -> wire (' model' )-> hasModifier (' defer' ) )
9+ _wireModelName: '{{ $attributes -> wire (' model' )-> value () } } ',
10+ @endif
811 @elseif ($hasXModel () )
912 value: {{ $attributes -> first (' x-model' ) } } ,
1013 @else
You can’t perform that action at this time.
0 commit comments