mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-03 12:37:40 +08:00
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:
parent
2d03d7fa53
commit
ef7f557a7f
@ -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
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user