Closed millette closed 1 year ago
Sure, I will gladly review such PR!
I've starting working on it but I've been pretty distracted today. Hope to have something to show tomorrow.
Turns out it almost works out of the box.
Without modifying your module, I have this demo: https://millette.github.io/tauto/
Source: https://github.com/millette/tauto/
It's basically your demo but I replaced the options with a call to https://lucaong.github.io/minisearch/class/src/MiniSearch.js~MiniSearch.html#instance-method-autoSuggest but you'll notice onRequestOptions
is just called once after the first character.
I'm not really sure what would be the best way to proceed to have options updated with every keystroke. Suggestions?
I think requestOnlyIfNoOptions
prop controls this behavior. At least, it should :)
From what I've seen, onRequestOptions
is only called when typing in the textarea. When the choices pop-up, we're typing in another scope, whether requestOnlyIfNoOptions
is true or false.
Closing due to inactivity
This is slightly related to #18 but more generic.
I'm using minisearch for client-side search and it also provides autocomplete suggestions.
I'd like to use
minisearch
(really, any similar function) to provide the suggestions dynamically. Not sure yet how the two would tie up but I'm going to try a PR and see what happens as my explanation probably isn't clear enough...