Hi,
I'm currently trying to make a radzen autocomplete focus after render but it doesn't seem to be working.
this is my code at the moment.
<RadzenAutoComplete name="searchbar" id="searchbar" Data="@AllItemNo" @bind-Value="@input" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" FilterOperator="StringFilterOperator.StartsWith" @onkeyup="KeyboardTrigger" @ref=@barcodeInput />
RadzenAutoComplete barcodeInput;
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
await barcodeInput.Element.FocusAsync();
}
}
enchev
2
You can try also alternative approach:
If I change my autocomplete to a textbox it works.
it doesn't work for autocomplete.
enchev
4
The TextBox will render simple input while the AutoComplete is a bit more complex:
UPDATE: We've decided to add FocusAsync() method:
okay so is there a way to focus an autocomplete or is it to complex to focus?
enchev
6
I've updated my reply, the new method will be part of our next update later this week.