fix scrolling bug caused by invalid filtering and sorting

This commit is contained in:
Sj-Si 2024-05-03 10:07:17 -04:00
parent ec300d6917
commit 2f8ee1998f

View File

@ -227,7 +227,11 @@ class ExtraNetworksClusterize extends Clusterize {
}
async sortDataDefaultCallback() {
this.data_obj_keys_sorted = this.sort_fn(this.data_obj);
// we want to apply the sort to the visible items only.
const filtered = Object.fromEntries(
Object.entries(this.data_obj).filter(([k, v]) => v.visible)
);
this.data_obj_keys_sorted = this.sort_fn(filtered);
if (this.sort_reverse) {
this.data_obj_keys_sorted = this.data_obj_keys_sorted.reverse();
}