Do not try to open/close empty collection tree rows on + and - hotkeys

Causes performance issues
This commit is contained in:
Adomas Venčkauskas 2021-04-14 12:25:55 +03:00 committed by Dan Stillman
parent b5dc0e7630
commit d83ec19c23

View file

@ -999,6 +999,7 @@ var CollectionTree = class CollectionTree extends LibraryTree {
}
toggleOpenState = async (index) => {
if (this.isContainerEmpty(index)) return;
if (this.isContainerOpen(index)) {
return this._closeContainer(index);
}
@ -2030,7 +2031,7 @@ var CollectionTree = class CollectionTree extends LibraryTree {
}
_closeContainer(row, skipMap) {
if (!this.isContainerOpen(row)) return;
if (!this.isContainerOpen(row) || this.isContainerEmpty(row)) return;
this.selection.selectEventsSuppressed = true;
let selectParent = this.getParentIndex(this.selection.focused);