mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-02 03:57:38 +08:00
fix(module: tree-select): exception when searching with nodes have no title (#4024)
* fix(module: tree-select): exception when searching with nodes have no title * fix focus
This commit is contained in:
parent
643ca11850
commit
58a499f8bf
@ -397,6 +397,8 @@ namespace AntDesign
|
||||
return;
|
||||
var node = args.Node;
|
||||
|
||||
_searchValue = string.Empty;
|
||||
|
||||
var key = node.Key;
|
||||
if (Multiple)
|
||||
{
|
||||
@ -421,6 +423,11 @@ namespace AntDesign
|
||||
{
|
||||
await CloseAsync();
|
||||
}
|
||||
|
||||
if (EnableSearch)
|
||||
{
|
||||
await SetInputFocusAsync();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -526,7 +526,7 @@ namespace AntDesign
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(_searchValue))
|
||||
{
|
||||
searchDatas = allList.Where(x => x.Title.Contains(_searchValue, StringComparison.InvariantCultureIgnoreCase)).ToList();
|
||||
searchDatas = allList.Where(x => !string.IsNullOrEmpty(x.Title) && x.Title.Contains(_searchValue, StringComparison.InvariantCultureIgnoreCase)).ToList();
|
||||
}
|
||||
|
||||
if (searchDatas != null && searchDatas.Any())
|
||||
|
Loading…
Reference in New Issue
Block a user