Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select Element #883

Open
woweya opened this issue Apr 22, 2024 · 3 comments
Open

Select Element #883

woweya opened this issue Apr 22, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@woweya
Copy link

woweya commented Apr 22, 2024

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 woweya added the bug Something isn't working label Apr 22, 2024
@woweya woweya changed the title Select Elements Select Element Apr 22, 2024
@nastoychev
Copy link
Contributor

nastoychev commented May 10, 2024

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

@woweya
Copy link
Author

woweya commented May 10, 2024

@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
Copy link
Contributor

nastoychev commented May 13, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants