wire-elements / spotlight

Livewire component that brings Spotlight/Alfred-like functionality to your Laravel application.
MIT License
912 stars 71 forks source link

Commands work but search gives console errors #74

Closed marchampson closed 2 years ago

marchampson commented 2 years ago

Love the package and sure this is something with my setup but I've tried a number of things and hit the same wall. When you search an indigo bar appears but it doesn't activate and the console fills with errors: image I have alpine installed as a module, it was 3.2 and now 3.9.1 - alpine components work. Any thoughts? Thanks.

kerynegan commented 2 years ago

Hi @PhiloNL - I'm having the same problem, though I'm using Alpine CDN.

My command (open a modal) does execute when I finish typing and hit enter, but it seems to be trying to execute every letter of the query as I type and throwing Console errors all the while.

Here's (an attempt at uploading) a gif screenshot in action. spotlight2

Any idea as to where to start to fix this? Happy to provide more information if that would be helpful. Thanks!

PhiloNL commented 2 years ago

I've tested this with 3.9.1 and it works. It might be related to the order, the following works for me:

// blade
@livewireStyles

@livewire('livewire-ui-spotlight')
@livewireScripts

<script src="/app.js"></script>
// app.js
require('../../vendor/wire-elements/modal/resources/js/modal')
import Alpine from 'alpinejs'

window.Alpine = Alpine
Alpine.start()