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) {
|
onFilterChange($event) {
|
||||||
const value = $event.detail.value.toLowerCase();
|
const query = $event.detail.value.toLowerCase();
|
||||||
this.menuTree.treeModel.filterNodes(node => {
|
this.menuTree.treeModel.clearFilter();
|
||||||
return node.data.name.toLowerCase().includes(value);
|
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) {
|
async onNodeMenuClick($event) {
|
||||||
|
Loading…
Reference in New Issue
Block a user