Search code examples
c#blazorfocusmudblazor

MudBlazor - MudAutocomplete opens the list on load, stealing focus


As in the title, upon loading the component opens the list of available search items stealing focus. Here is a reproduction of the issue: https://try.mudblazor.com/snippet/mOGSYNwqReIIifvX

I tried changing the parameters (e.g. AutoFocus=false) and using a MudFocusTrap but neither seemed to work. I expect the list to open only on click, not on page load.


Solution

  • remove Text="@SearchProductName" all works. you have

    private void SearchTextChanged(string productName)
    {
        SearchProductName = productName;
        //call search event in singleton service
    }
    
     
    

    to reflect change to model. Or try to find different way to bind