wire-elements / spotlight

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

Spotlight doesn't react on click event dispatch #98

Closed syntafin closed 1 year ago

syntafin commented 1 year ago

Good day,

months ago the dispatch event on a button to open spotlight on mobile stopped working, as we are still in early development, it wasn't necessary to fix it. But soon we will go to launch phase.

At the moment the button has a dispatcher in a alpine.js Click event that look like this:

@click="$dispatch('toggle-spotlight')"

This way it is described in the docs. I can't see any log message in the console. Someone an idea?

Live Preview of the problem: https://dev.xivdata.com

The toggle button (search symbol) only appears below MD Viewport

PhiloNL commented 1 year ago

Hi there, @click only works on a Alpine scoped element, so you will need to add x-data to the button or a parent element.