我有兩個(gè)選擇控件和一個(gè)按鈕。一旦選擇了一個(gè)選項(xiàng),選擇范圍似乎就縮小了。我在這里重現(xiàn)了這個(gè)問(wèn)題:
片段鏈接
這是相關(guān)的代碼:
<div class="d-flex justify-space-between mx-2">
<MudGrid>
<MudItem xs="12" md="4" sm="4">
<MudSelect T="string" Label="From Language" @bind-Value="@fromLanguage" Variant="Variant.Filled" Style="min-width: 200px;" FullWidth="true" Dense="true" DisableUnderLine="true" Class="et-select-input d-flex align-center justify-center mud-width-full py-8">
@foreach (var language in languages)
{
<MudSelectItem Value="@language">@language</MudSelectItem>
}
</MudSelect>
</MudItem>
<MudItem xs="12" md="4" sm="4">
<MudSelect T="string" Label="To Language" @bind-Value="@toLanguage" Variant="Variant.Filled" Dense="true" Style="min-width: 200px;" FullWidth="true" DisableUnderLine="true" Class="et-select-input d-flex align-center justify-center mud-width-full py-8">
@foreach (var language in languages)
{
<MudSelectItem Value="@language">@language</MudSelectItem>
}
</MudSelect>
</MudItem>
<MudItem>
<MudButton Color="MudBlazor.Color.Primary" Class="py-14 d-flex flex-1" >Do something</MudButton>
</MudItem>
</MudGrid>
</div>
@code {
private List<string> languages = new List<string> { "English", "Spanish", "French", "German", "Dutch" };
private string fromLanguage = "";
private string toLanguage = "";
}
我做錯(cuò)了什么?
編輯:我在Mudblazor的官方頁(yè)面上也注意到了同樣的行為: 這里
您需要從MudSelect中移除對(duì)齊中心。
<MudSelect T="string" Label="From Language" @bind-Value="@fromLanguage" Variant="Variant.Filled" Style="min-width: 200px;" FullWidth="true" Dense="true" DisableUnderLine="true"
Class="et-select-input py-8">
//
</MudSelect>
Mudblazor片段