1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-12-01 22:38:08 +00:00

Fix: bug with List Widget where the counter-last variable is not always accurately updated on refresh (#5883)

This commit is contained in:
Saq Imtiaz
2021-07-15 22:59:07 +02:00
committed by GitHub
parent be026aa308
commit cb726f40fa
2 changed files with 30 additions and 0 deletions

View File

@@ -236,6 +236,11 @@ ListWidget.prototype.handleListChanges = function(changedTiddlers) {
hasRefreshed = hasRefreshed || refreshed;
}
}
// If there are items to remove and we have not refreshed then recreate the item that will now be at the last position
if(!hasRefreshed && this.children.length > this.list.length) {
this.removeListItem(this.list.length-1);
this.insertListItem(this.list.length-1,this.list[this.list.length-1]);
}
} else {
// Cycle through the list, inserting and removing list items as needed
for(t=0; t<this.list.length; t++) {