Search code examples
mudblazor

MudSelect Label not moving to border on bind


I have a Mudselect bind-value to a datavalie coming from an api call , upon receiving data the mudselect shows the corresponding value but the label isnt moving from the centre of the mudselect to its position in the top border

seems this intermittent behaviour is either position on form based or some other external factor as some of the selects on the page work and some don't

<MudSelect T="string" Variant="Variant.Outlined" Label="Install Standard" Clearable="true" @bind-value="Quote.InstalledToStandardId" For="@(() => Quote.InstalledToStandardId)"> @foreach (AttributeValueForGrid attvalue in AttributeValueList.Where(av => av.AttributeType == AttributeValueType.AttributeValueTypes["InstallStandard"])) { <MudSelectItem T="string" Value="@attvalue.Id">@attvalue.Value</MudSelectItem> } </MudSelect>

have tried moving where on page select appears and also pugging in own paper or div


Solution

  • Change the @bind-value to @bind-Value(capital V)

    Value is a MudSelect property whereas value is an HTML attribute. The components wrap itself around other HTML elements. Binding a component directly to an HTML attribute will potentially lead to unexpected behaviours.