Steps to reproduce:
- Run the attached project.
- Select
Alice
in the combobox. - Click the
Clear
button.
Expected results:
The combobox is cleared.
Current results:
The combobox is not cleared.
Two possible workarounds:
1. Add a timeout:
C#private async Task ClearClick() {
await GetOperatorAsync();
OperatorData = await GetOperatorAsync();
await Task.Delay(1);
Operator = string.Empty;
}
2. Reset the @key property:
Bind the DxComboBox @key
property to a GUID variable:
Razor<DxComboBox @ref="OperatorComboBox"
@key="@CbKey"
.../>
@code {
Guid CbKey { get; set; } = Guid.NewGuid();
}
Reset this variable:
C#private async Task ClearClick() {
await GetOperatorAsync();
OperatorData = await GetOperatorAsync();
Operator = string.Empty;
CbKey = Guid.NewGuid();
}