wire-elements / spotlight

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

Search dependency - prevent active search #40

Closed blhi-jed closed 2 years ago

blhi-jed commented 3 years ago

Awesome package by the way!

I made one with a dependency where users are able to enter a keyword search through thousands of row table. however since this is an active search, as expected, memory issues are encountered each time a user types.

Is there a way to prevent active-search and only triggers on-Enter? or something similar to Livewire's defer property?

PhiloNL commented 2 years ago

Publish the view and change this line: https://github.com/livewire-ui/spotlight/blob/master/resources/views/spotlight.blade.php#L43

x-model="input" to x-model.debounce="input"