diff --git a/src/tree-node/index.js b/src/tree-node/index.js index 4c58a49c..342d7fec 100644 --- a/src/tree-node/index.js +++ b/src/tree-node/index.js @@ -82,7 +82,9 @@ class TreeNode extends PureComponent { if (mode !== 'simpleSelect') { attributes['aria-checked'] = partial ? 'mixed' : checked attributes['aria-level'] = (_depth || 0) + 1 - attributes['aria-expanded'] = _children && (expanded ? 'true' : 'false') + _children !== undefined && _children.length > 0 + ? (attributes['aria-expanded'] = _children && (expanded ? 'true' : 'false')) + : null } return attributes }