Merge pull request #145 from rpominov/fix-tree-flicker

Fix tree flicker
This commit is contained in:
Oleg Isonen authored and GitHub committed 2022-07-14 10:24:47 +02:00
commit 06945e7fb7
1 file changed
+2 -2
@@ -64,7 +64,7 @@ export const Tree = ({
instance.children.length > 1 || typeof instance.children[0] === "object";
const children = useMemo(() => {
if (isOpen === false || showChildren === false) {
if ((isOpen === false && animate === false) || showChildren === false) {
return null;
}
const children = [];
@@ -127,7 +127,7 @@ export const Tree = ({
<Text>{label}</Text>
</Button>
</Flex>
<CollapsibleContent>{children}</CollapsibleContent>
{children != null && <CollapsibleContent>{children}</CollapsibleContent>}
</Collapsible.Root>
);
};