I am having problem trying to auto focus a textarea/input tag using .NET MAUI Blazor when a page is loaded. Happens only on Android but iOS is working fine. And it does not showing any error at all. Just nothing happen.
here are my codes:
<input type="text" @ref="myref" />
<script>
window.exampleJsFunctions =
{
focusElement: function (element) {
element.focus();
}
};
</script>
private ElementReference myref;
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
await JSRuntime.InvokeVoidAsync("exampleJsFunctions.focusElement", myref);
}
}