wireui / wireui

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

Select Element #883

Open woweya opened 3 weeks ago

woweya commented 3 weeks ago

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

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

nastoychev commented 6 days ago

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

woweya commented 6 days ago

@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

nastoychev commented 4 days ago

@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)?