Fix sidebar search to force-include virtual nodes (#14)
This commit is contained in:
parent
6532bd7dc1
commit
d3af6611c6
@ -93,10 +93,18 @@ export class AppComponent implements OnInit {
|
||||
}
|
||||
|
||||
onFilterChange($event) {
|
||||
const value = $event.detail.value.toLowerCase();
|
||||
this.menuTree.treeModel.filterNodes(node => {
|
||||
return node.data.name.toLowerCase().includes(value);
|
||||
});
|
||||
const query = $event.detail.value.toLowerCase();
|
||||
this.menuTree.treeModel.clearFilter();
|
||||
if ( query ) {
|
||||
this.menuTree.treeModel.filterNodes(node => {
|
||||
if ( node.data.virtual ) {
|
||||
// "Virtual" tree nodes should always be shown
|
||||
return true;
|
||||
}
|
||||
|
||||
return node.data.name.toLowerCase().indexOf(query) >= 0;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async onNodeMenuClick($event) {
|
||||
|
Loading…
Reference in New Issue
Block a user