On a blazor page, I have a html select element.
<select class="form-select" @bind="Model.ItemId">
@foreach (var item in Items)
{
<option value="@item.Id">@item.Name</option>
}
</select>
Using IJSInterop, I am calling a javascript function to focus on the select element, and then try to click it.
...
select.focus();
var activeElement = document.activeElement;
activeElement.click();
Everything seems to work fine, except when the select element is “clicked” the options don’t show on the screen.
I don’t know if blazor makes any difference from standard html in this scenario. Any ideas?