Skip to content

Commit 236039b

Browse files
fix(@clayui/core): Fixes error when not keeping node expandable when it starts as true
1 parent 455002c commit 236039b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/clay-core/src/tree-view/TreeViewGroup.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66
import {setElementFullHeight} from '@clayui/shared';
7+
import classNames from 'classnames';
78
import React from 'react';
89
import {CSSTransition} from 'react-transition-group';
910

@@ -27,7 +28,9 @@ export function TreeViewGroup<T extends Record<any, any>>({
2728

2829
return (
2930
<CSSTransition
30-
className="collapse"
31+
className={classNames('collapse', {
32+
show: expandedKeys!.has(item.key),
33+
})}
3134
classNames={{
3235
enter: 'collapsing',
3336
enterActive: 'show',

0 commit comments

Comments
 (0)