wireui icon indicating copy to clipboard operation
wireui copied to clipboard

Select Element

Open woweya opened this issue 1 year ago • 3 comments

I coded the<x-select> as the documentation says:

<x-select
    label="Search a User"
    placeholder="Select some user"
    :async-data="route('api.users.index')"
    option-label="name"
    option-value="id"
/>

And this is my Controller:

 public function __invoke(Request $request)
    {
        
        return User::query()
            ->select('id', 'name', 'email')
            ->when(
                $request->search,
                fn (Builder $query) => $query
                    ->where('name', 'like', "%{$request->search}%")
                    ->orWhere('email', 'like', "%{$request->search}%")
            )
            ->when(
                $request->exists('selected'),
                fn (Builder $query) => $query->whereIn('id', $request->input('selected', [])),
                fn (Builder $query) => $query->limit(10)
            )
            ->orderBy('name')
            ->get()
            ->map(function (User $user) {

                return $user;
            });
    }

In the Website I get an error of Alpine that says:

livewire.js?id=239a5c52:1207 Uncaught ReferenceError: wireui_select is not defined
    at [Alpine] wireui_select({
            })

In addition, the Select area "the one that should show up after clicked the x-select", it shows up for only some seconds and then it disappears with display:none.

Dependencies

  • WireUI Version: 2
  • Laravel Version: 11x
  • Livewire Version:3x
  • Lang: en_US

Desktop (If applicable, please complete the following information):

  • OS: Windows
  • Browser: Chrome

woweya avatar Apr 22 '24 17:04 woweya

@woweya I have the same Issue, with the Select besides ...Alpine error. I will try to fix it

nastoychev avatar May 10 '24 12:05 nastoychev

@woweya I have the same Issue, with the Select besides ...Alpine error. I will try to fix it

Yes, wireUI and Alpine often breaks Even with Dialogs and Modals I get the same error even though I coded as the documentation said

woweya avatar May 10 '24 13:05 woweya

@woweya I forgot to mention that I use version v1.19.0 Latest. V2 is still in progress. Is there a reason to not use v1 (as suggested in README.md)?

nastoychev avatar May 13 '24 08:05 nastoychev

Thank you for using WireUi!

We released stable version 2, with new features and improvements. Check if the mentioned problem has been resolved, if not, reopen this issue and we will provide more information. Thank you in advance, we are organizing Issues for better maintenance.

joaopalopes24 avatar Jun 13 '24 22:06 joaopalopes24