Fix sidebar search to force-include virtual nodes (#14)
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details

pull/18/head
Garrett Mills 4 years ago
parent 6532bd7dc1
commit d3af6611c6
Signed by: garrettmills
GPG Key ID: D2BF5FBA8298F246

@ -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…
Cancel
Save