add method to partially update the search query
This commit is contained in:
@@ -146,6 +146,16 @@ export class UmbPickerModalSearchManager<
|
||||
return this.#query.getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the current search query.
|
||||
* @param {Partial<QueryType>} query
|
||||
* @memberof UmbPickerModalSearchManager
|
||||
*/
|
||||
public updateQuery(query: Partial<QueryType>) {
|
||||
const mergedQuery = { ...this.getQuery(), ...query } as QueryType;
|
||||
this.#query.setValue(mergedQuery);
|
||||
}
|
||||
|
||||
async #initSearch() {
|
||||
const providerAlias = this.#config?.providerAlias;
|
||||
if (!providerAlias) throw new Error('No search provider alias provided');
|
||||
|
||||
@@ -34,7 +34,7 @@ export class UmbPickerModalSearchElement extends UmbLitElement {
|
||||
|
||||
#onInput(event: UUIInputEvent) {
|
||||
const value = event.target.value as string;
|
||||
this.#pickerModalContext?.search.setQuery({ query: value });
|
||||
this.#pickerModalContext?.search.updateQuery({ query: value });
|
||||
this.#pickerModalContext?.search.search();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user