Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/modules/search/components/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export interface IResultContext<T> extends ITemplateRefContext<T> {
export class SuiSearch<T> implements AfterViewInit, OnDestroy {
public dropdownService:DropdownService;
public searchService:SearchService<T, T>;
private _inputValue:any = false;

@ViewChild(SuiDropdownMenu)
private _menu:SuiDropdownMenu;
Expand Down Expand Up @@ -85,6 +86,12 @@ export class SuiSearch<T> implements AfterViewInit, OnDestroy {
this._placeholder = placeholder;
}

// Sets the input value text without triggering a search.
@Input()
public set inputValue(query:string) {
this._inputValue = (query == '' || query == null)?false:query;
}

private _localeValues:ISearchLocaleValues;

public localeOverrides:RecursivePartial<ISearchLocaleValues>;
Expand All @@ -94,10 +101,16 @@ export class SuiSearch<T> implements AfterViewInit, OnDestroy {
}

public get query():string {
return this.searchService.query;
if(this._inputValue){
return this._inputValue;
}
else{
return this.searchService.query;
}
}

public set query(query:string) {
this._inputValue = false;
this.selectedResult = undefined;
// Initialise a delayed search.
this.searchService.updateQueryDelayed(query, () =>
Expand Down