wireui / wireui

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

x-select unable to select option and showing sub undefined #284

Closed 7met closed 1 year ago

7met commented 1 year ago

Describe the bug I did a composer update today and went from v1.0.0 to 1.3.2 and now x-native-selects work fine but x-select have strange behavior that when you pull the drop down you see the option and then under that undefined and everything shows checked but you cannot select anything Screen Shot 2022-05-19 at 12 38 57 PM

here is a copy of my code I am using to define it:

<x-select
  label="Room or Resource"
  placeholder="Optionally, select a resource"
  wire:model="resource_id"
  class="form-input-clean"
>
  @foreach($resources as $resource)
    <x-select.option label="{{ $resource->name}}" value="{{ $resource->id}}" />
  @endforeach
</x-select>

To Reproduce Steps to reproduce the behavior:

  1. Update WireUI via composer update
  2. Publish views and configs per https://livewire-wireui.com/docs/get-started
  3. Load page

Expected behavior Before the update, we just got the options and were able to select one. We should be able to select an option from a x-select component

Environment Laravel 9.1 PHP 8.1 WireUI 1.3.2 TailwindCSS 3 Livewire 2.10.5

7met commented 1 year ago

I get the same issue even when I use the example from the docs directly (https://livewire-wireui.com/docs/select)

<x-select
   label="Select Status"
   placeholder="Select one status"
   :options="['Active', 'Pending', 'Stuck', 'Done']"
/>
PH7-Jack commented 1 year ago

@7met Did you update your published views after the update?

PH7-Jack commented 1 year ago

Does this code example not work for you? https://livewire-wireui.com/docs/select#slot-options

PH7-Jack commented 1 year ago

@7met what's your alpinejs version?

allanpusta13 commented 1 year ago

@7met See this #273 please, maybe this would help you.

7met commented 1 year ago

@PH7-Jack I am using Alpine 3.4.2 and I even deleted the wireui directory under resources/views/vendor and republished the directory. I will try the example with slot options and let you know. To item #273, I am not using powergrid but I will see if maybe there is something else calling Alpine by CDN but I don't see any warnings in the console.

7met commented 1 year ago

@PH7-Jack Ok I took a long shot and deleted the config file and republished that (Before I just ran the command thinking it would overwrite it) with the new config file everything works. Ticket can be closed.

BTW, I would love to sponsor the project if you turned it on. You are doing amazing work and always so responsive.

PH7-Jack commented 1 year ago

@7met I recommend using the latest alpine version v3.10.2 The alpine and livewire are in constant growth, and some fixes are in the latest version, I always use the alpine/livewire/laravel in the latest version to prevent bugs If you have two alpinejs scripts, it will conflict. See your layout if you have any script importing the alpine twice Another thing is the published views, if you never customize them you don't need to publish them.

PH7-Jack commented 1 year ago

@7met Thanks a lot for using and loving the WireUI. You can feel free to open an issue when you have a new bug, sometimes I'm busy to resolve it faster, but I like to solve all things. Glad to know that everything is working fine for you. About the sponsorship, I'm open to this. While GitHub doesn't allow me to use the sponsored feature, I'm using Paypal or similar. You can send an email to me and talk about it. I'm really happy with your interest 38913462+PH7-Jack@users.noreply.github.com

ettiennelouw commented 1 year ago

I got the same error and after updating to the latest alpine and deleting and dumping assets again everything works as expected.