Fix item tree breakage if annotation is added while search is active
This commit is contained in:
parent
bb2f1ced99
commit
d5334dc483
1 changed files with 8 additions and 0 deletions
|
@ -1892,9 +1892,17 @@ Zotero.ItemTreeView.prototype.selectItems = async function (ids, noRecurse) {
|
|||
var rowsToSelect = [];
|
||||
for (let id of idsToSelect) {
|
||||
let row = this._rowMap[id];
|
||||
if (!row) {
|
||||
Zotero.debug(`Item ${id} not in row map -- skipping`);
|
||||
continue;
|
||||
}
|
||||
rowsToSelect.push(row);
|
||||
}
|
||||
|
||||
if (!rowsToSelect.length) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// If items are already selected, just scroll to the top-most one
|
||||
var selectedRows = new Set(this.getSelectedRowIndexes());
|
||||
if (rowsToSelect.length == selectedRows.size && rowsToSelect.every(row => selectedRows.has(row))) {
|
||||
|
|
Loading…
Reference in a new issue