refactor(#248): extract typeahead logic into createTypeahead composable, use in PersonTypeahead
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -41,6 +41,12 @@ export function createTypeahead<T>(options: Options<T>) {
|
||||
close();
|
||||
}
|
||||
|
||||
/** Directly populate results without going through the debounce (e.g. on-focus preload). */
|
||||
function openWith(items: T[]) {
|
||||
results = items;
|
||||
isOpen = true;
|
||||
}
|
||||
|
||||
return {
|
||||
get query() {
|
||||
return query;
|
||||
@@ -59,6 +65,7 @@ export function createTypeahead<T>(options: Options<T>) {
|
||||
},
|
||||
setQuery,
|
||||
close,
|
||||
select
|
||||
select,
|
||||
openWith
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user