Recaf icon indicating copy to clipboard operation
Recaf copied to clipboard

Folder loses expandability when deleting one of the two remaining children

Open Col-E opened this issue 3 years ago • 0 comments

java_E0w4QW3rZQ

// In BaseTreeItem
if (item.isUnfilteredLeaf()) {
	// It is a terminal node, can remove
	parent.removeChild(item);
} else if (item.isCandidateForHiding()) {
	// The item is not a true leaf, but visibly due to the filter
	// it may be treated as one visually. So rather than delete
	// we only want to hide the item.
	parent.hideChild(item);
}

The isCandidateForHiding() method will always be true if a tree-item only has one sub-item. This becomes the case when deleting the one of the two leaves of a tree-item that has only two items.

Col-E avatar Jul 02 '22 08:07 Col-E