wireui / wireui

TallStack UI components
https://v1.wireui.dev
MIT License
1.37k stars 166 forks source link

Props not passing through/nested wire:model #136

Closed bawbanksy closed 1 year ago

bawbanksy commented 2 years ago

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.

PH7-Jack commented 2 years ago

@bawbanksy I don't understood. Add an example and explain the issue

bawbanksy commented 2 years ago

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

PH7-Jack commented 2 years ago

Change the wire:model.delay to wire:model.defer

bawbanksy commented 2 years ago

That didn't do it... ill try and log some more data.

PH7-Jack commented 2 years ago

You have the model rules into the component? Try with wire:model

PS: What's your alpine and livewire version?

bawbanksy commented 2 years ago

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

PH7-Jack commented 2 years ago

Update the AlpineJs to v3, the wireui don't support the v2

bawbanksy commented 2 years ago

Already on v3.

Seems to be when trying to store the multiple options in array.

This works fine- `