Closed bawbanksy closed 1 year ago
@bawbanksy I don't understood. Add an example and explain the issue
My mistake omitted the example.
here is the wire-ui code-
<x-datetime-picker class="p-4" without-time placeholder="Provision Date" wire:model.delay="site.{{ $key }}.provisiondate" />
It would seem that the dot notation is not supported as is in normal inputs
Change the wire:model.delay
to wire:model.defer
That didn't do it... ill try and log some more data.
You have the model rules into the component?
Try with wire:model
PS: What's your alpine and livewire version?
Tried wire:model with no avail. Can you elaborate on "You have the model rules into the component?"
Form is super basic at the moment, no validation. Props are declared and standard inputs work no problem.
alpine v.3.5.0 livewire v2.7.2
Update the AlpineJs to v3, the wireui don't support the v2
Already on v3.
Seems to be when trying to store the multiple options in array.
This works fine- `
<option value="saab">Saab</option>
<option value="opel">Opel</option>
<option value="audi">Audi</option>
</select>`
this results in-
[2021-11-24 00:42:13] local.INFO: array ( 1 => array ( 'name' => 'syd', 'speed' => array ( 0 => 'volvo', 1 => 'saab', ), ), 2 => array ( 'name' => 'melb', 'speed' => array ( 0 => 'saab', 1 => 'opel', 2 => 'audi', ), ), )
when using x-select it doesn't even attempt to populate/store in the array.
Show me your x-select code
Http/Livewire/Sitecreation.php-
class Sitecreation extends Component
{
//Site
public $site = [];
sitecreation.blade.php-
<x-select class="p-4" placeholder="Select speeds" multiselect :options="['10Mbps', '25Mbps', '50Mbps', '100Mbps', '250Mbps', '500Mbps', '1Gbps', '10Gbps']" wire:model="site.{{ $key }}.speed" />
Standard select populates the array no problem. X-Select doesn't.
@bawbanksy can you record a video to show this issue?
Hello @bawbanksy, this issue was inactive for a long time, I'm closing it now. If this bug still happening, tag me with the "RE-OPEN" comment to let me know.
@PH7-Jack RE-OPEN
I have the same exact problem.
PHP 8.1.10 Laravel 9.39.0 Livewire 2.10.7 WireUI 1.17.5 Alpine 3.10.5
Simple component:
class Test extends Component
{
public $filters;
public function render()
{
return view('livewire.test');
}
}
The view:
<div>
<x-select
label="Select Status"
placeholder="Select one status"
:options="['Active', 'Pending', 'Stuck', 'Done']"
wire:model="filters.test"
/>
</div>
If instead of "filters.test" I use "filters" or any other non nested binding, it works as expected. I have already tried all the above suggestions like the validation rules and the defer/delay combination.
In the browser I have a lot of message/erros:
i have same problem
When using nested binding with wire:model on a select or date picker the data doesn't return to array.
code:
@props([ 'key', 'site', ])
standard selects/inputs have no problem.