fix(module: select): broken removing of selected tag (#613)

* fix(module: select): broken removing of selected tag

* refactor: remove comment
This commit is contained in:
笨木头 2020-09-17 14:14:48 +08:00 committed by GitHub
parent 2d03d7fa53
commit ef7f557a7f
2 changed files with 3 additions and 7 deletions

View File

@ -393,7 +393,6 @@ namespace AntDesign
protected async void OnRemoveSelected(SelectOption option)
{
await Task.Delay(100);
var value = option?.Value;
if (option.IsTag)
{
@ -423,7 +422,6 @@ namespace AntDesign
}
OnChange?.Invoke(SelectedValues.Value, SelectedOptions);
//await InvokeAsync(StateHasChanged);
}
#endregion

View File

@ -50,7 +50,7 @@
{
if (ParentSelect.TagRender != null)
{
<span>@ParentSelect.TagRender(GetProperties(option))</span>
<span @key="@option.Value">@ParentSelect.TagRender(GetProperties(option))</span>
}
else
{
@ -67,7 +67,7 @@
}
</span>
@if (ParentSelect.SelectMode == SelectMode.Tags)
@if (ParentSelect.SelectMode == SelectMode.Tags || ParentSelect.SelectMode == SelectMode.Multiple)
{
<span unselectable="on" aria-hidden="true" style="user-select: none;" class="@Prefix-selection-item-remove"
@onclick="()=>OnRemoveSelected.InvokeAsync(option)" @onclick:stopPropagation="true">
@ -200,9 +200,7 @@
Closable = true,
Value = option.Value,
Label = option.Label,
OnClose = Action
OnClose = (e) => { OnRemoveSelected.InvokeAsync(option); }
};
void Action(MouseEventArgs e) => OnRemoveSelected.InvokeAsync(option);
}
}