perf: remove specific elements instead of re-rendering entire list (#25078)

This commit is contained in:
Raffael Meyer 2024-02-27 08:38:26 +01:00 committed by GitHub
parent 98fac311a8
commit b3ff1f9fcc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1471,8 +1471,13 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
// this doc was changed and should not be visible
// in the listview according to filters applied
// let's remove it manually
this.data = this.data.filter((d) => names.indexOf(d.name) === -1);
this.render_list();
this.data = this.data.filter((d) => !names.includes(d.name));
for (let name of names) {
this.$result
.find(`.list-row-checkbox[data-name='${name}']`)
.closest(".list-row-container")
.remove();
}
return;
}