Closed allanpusta13 closed 1 year ago
Are you using the latest alpinejs version?
yes
Could you show me your select config?
i.g
<x-select .... />
@allanpusta13 if you use the WireUI example, does it's work?
<x-select
label="Select Status"
placeholder="Select one status"
:options="[
['name' => 'Active', 'id' => 1],
['name' => 'Pending', 'id' => 2],
['name' => 'Stuck', 'id' => 3],
['name' => 'Done', 'id' => 4],
]"
option-label="name"
option-value="id"
wire:model.defer="model"
/>
Also tried it sir but it won't work
Could you set the default model value to null?
I'll try
it has the same error
Or try to delay the alpine starts, use the WireUI load hook to start the alpinejs, I think is something with the alpine js But, make sure if your wireui, alpine and livewire are updated, and the scripts are in the correct order in your layout https://livewire-wireui.com/docs/get-started
import Alpine from 'alpinejs'
window.Alpine = Alpine
window.Wireui.hook('load', () => Alpine.start())
I tried it Sir but more errors came up
@PH7-Jack same problem
Could you reproduce this error in a new project and put it on GitHub? Without the full context is hard to know what is firing this error
@PH7-Jack Sir I have the sample here, cheers to your work and I love wireui, it would really help me a lot if this would be solved.
All in the composer packages are on their latest versions.
@allanpusta13 Good, looking at it now.
Noted and looking forward to your feedback!
@allanpusta13 The bug only happens when the powergrid scripts is added to the layout
@PH7-Jack so I have to remove the powergrid script on every form?
I understand this problem now. Your project was not configured properly with the PowerGrid See this guide Just configure correctly your project. WireUI + PG is a good choice https://livewire-powergrid.com/#/get-started/configure?id=_22-as-a-module
Remember to use the lastest Alpinejs version
Closing this issue now.
@allanpusta13 @Tiagospem Only for reference: This error happens because the alpine js is loaded in the script and in the PG CDN. Use only one of these. Import the pg scripts in the app.js module Is better to set the alpine_cdn to null
If this error still happening, tag me with the "RE-OPEN" comment.
@PH7-Jack worked like a charm! Thanks so much for the tips and solution!
I didn't seem to try to config the powergrid previously because it was working well with the previous versions of wireui.
Again Thanks a lot!!!
Options has value like previously on other versions was working.
Upon update options on dropdown is not rendering and errors occur like it said. "Uncaught TypeError: Cannot convert undefined or null to object"
Laravel 9 Latest WireUi