diff --git a/chrome/content/zotero/itemTree.jsx b/chrome/content/zotero/itemTree.jsx index 6538b91d61..0bc062f0a4 100644 --- a/chrome/content/zotero/itemTree.jsx +++ b/chrome/content/zotero/itemTree.jsx @@ -705,6 +705,16 @@ var ItemTree = class ItemTree extends LibraryTree { sort = id; } } + // If a trashed child item is restored while its parent's row is expanded, + // collapse and re-open the parent to have that child item row added. + else { + let parentItemRowIndex = this.getRowIndexByID(item.parentItemID); + if (parentItemRowIndex === false) continue; + if (this.isContainerOpen(parentItemRowIndex)) { + this.toggleOpenState(parentItemRowIndex, true); + await this.toggleOpenState(parentItemRowIndex); + } + } } if (sort && ids.length != 1) {