citation dlg: fix collectionTree rendering (#5114)

After switching from list mode to library mode if
the selected collection row is close to the bottom.

Fixes: #5104
This commit is contained in:
abaevbog 2025-03-13 20:33:12 -07:00 • committed by GitHub
parent a98d172cd7
commit 92d6e69b6e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -290,10 +290,13 @@ class Layout {
if (this.forceUpdateTablesAfterRefresh && this.type == "library") {
this.forceUpdateTablesAfterRefresh = false;
setTimeout(() => {
libraryLayout.collectionsView?.tree.invalidate();
libraryLayout.itemsView.tree?.invalidate();
libraryLayout.collectionsView?.tree.forceUpdate();
libraryLayout.itemsView.tree?.forceUpdate();
// Necessary for the collectionTree to be properly rendered after switching to library mode
if (libraryLayout.collectionsView) {
let currentCollectionIndex = libraryLayout.collectionsView.tree.selection.focused;
libraryLayout.collectionsView.ensureRowIsVisible(currentCollectionIndex);
}
}, 250);
}
}