wire-elements / spotlight

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

Allow just for one command in Spotlight for using it as a search for one model #130

Open patimio66 opened 3 months ago

patimio66 commented 3 months ago

Hello, It'd be great if it'd be possible to use Spotlight as just one command, without additional "Enter" clicking after opening the modal if we have one command. This of course could be optional/modified in the config file or somewhere else. For example, there'd be a \App\Spotlight\FindProduct::class, and it would by default search for a product if you type in after going into CMD/CTRL K//. Whatdya think?

patimio66 commented 3 months ago

Maybe it'd just run the go() command after a short timeout, on toggleOpen()? I'm sorry but I'm not so experienced and I don't know how to make that as a ready-to-merge PR. (I don't know how to resolve it in JS/Livewire) image