SamProf / MatBlazor

Material Design components for Blazor and Razor Components
http://www.matblazor.com
MIT License
2.84k stars 386 forks source link

MatSelectItem not showing items when initially disabled then enabled #770

Open ldcroberts opened 3 years ago

ldcroberts commented 3 years ago

Describe the bug The drop down doesn't work with the Disabled flag properly. If its initially disabled, then when enabled it doesn't drop down or display anything. If I flip the logic so its initially enabled then it works fine when later disabled and enabled.

Surprisingly, it works perfectly in blazorfiddle. But exactly the same code created using visual studio, created using a fresh template with only the code below (and the usual nuget/using/static tweaks) shows that the dropdown stops working.

MatBlazor 2.7.0

To Reproduce @page "/"

<MatSelectItem @bind-Value="@deliveryOptionsValue" Items="@deliveryOptionsItems"> </MatSelectItem> <MatSelectItem @bind-Value="@emailEngineValue" Items="@emailEngineItems" Disabled="@(deliveryOptionsValue == "Post Only")"> </MatSelectItem>

@code {

string[] deliveryOptionsItems = new string[]
        {
            "Post Only",
            "Email Only",
            "Both Email and Post"
            };

string deliveryOptionsValue = "Post Only";

string[] emailEngineItems = new string[]
        {
            "Central Server",
            "User mail client"
            };

string emailEngineValue = "Central Server";

}

I have copied my entire code into blazor fiddle and it works fine, exactly the same code doesn't work in visual studio/iis. Both MatSelectItem and MatSelectValue are impacted the same way. I do not know how to debug this further?

Here is the blazor fiddle: https://blazorfiddle.com/s/kl9mq7i1

My colleague tried on his development computer and I tried on another browser, and it is still problematic and reproduceable in visual studio

Ogglas commented 3 years ago

Still present, does not work to toggle either