Skip to content

Commit

Permalink
HxAutosuggest - demos fine-tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
hakenr committed Aug 1, 2023
1 parent e9d9891 commit 006d3ff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@inject IDemoDataService DemoDataService

<HxAutosuggest Label="Employee"
Placeholder="Start typing to see suggestions"
Placeholder="Start typing to search by name"
TItem="EmployeeDto"
TValue="int?"
@bind-Value="@selectedEmployeeId"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@inject IDemoDataService DemoDataService

<HxAutosuggest Label="Employee"
Placeholder="Click here to see initial suggestions, start typing to search for more"
Placeholder="Click here to see initial suggestions, start typing to search by name"
TItem="EmployeeDto"
TValue="int?"
@bind-Value="@selectedEmployeeId"
Expand All @@ -23,14 +23,14 @@

private async Task<AutosuggestDataProviderResult<EmployeeDto>> ProvideSuggestions(AutosuggestDataProviderRequest request)
{
if (request.UserInput?.Length < 3)
if (request.UserInput?.Length > 0)
{
var initialSuggestions = await DemoDataService.GetPreferredEmployeesAsync(count: 10, request.CancellationToken);
return new AutosuggestDataProviderResult<EmployeeDto>() { Data = initialSuggestions };
var matchingEmployees = await DemoDataService.FindEmployeesByNameAsync(request.UserInput, limitCount: 10, request.CancellationToken);
return new AutosuggestDataProviderResult<EmployeeDto> { Data = matchingEmployees };
}

var matchingEmployees = await DemoDataService.FindEmployeesByNameAsync(request.UserInput, limitCount: 10, request.CancellationToken);
return new AutosuggestDataProviderResult<EmployeeDto> { Data = matchingEmployees };
var initialSuggestions = await DemoDataService.GetPreferredEmployeesAsync(count: 10, request.CancellationToken);
return new AutosuggestDataProviderResult<EmployeeDto>() { Data = initialSuggestions };
}

private async Task<EmployeeDto> ResolveAutosuggestItemFromValue(int? value)
Expand Down

0 comments on commit 006d3ff

Please sign in to comment.