diff --git a/build/Tree.js b/build/Tree.js index dab87f6..b93f191 100644 --- a/build/Tree.js +++ b/build/Tree.js @@ -527,6 +527,9 @@ var Tree = function (_React$Component) { selectedKeys: selectedKeys }); } + this.setState({ + focusKey: '' + }); props.onSelect(selectedKeys, newSt); }; @@ -676,8 +679,9 @@ var Tree = function (_React$Component) { var prevTreeNode = void 0, preElement = void 0; + var treeNodes = props.children || this.cacheTreeNodes; //选中上一个相邻的节点 - (0, _util.loopAllChildren)(props.children, function (item, index, pos, newKey) { + (0, _util.loopAllChildren)(treeNodes, function (item, index, pos, newKey) { if (pos == prePos) { prevTreeNode = item; } @@ -795,7 +799,7 @@ var Tree = function (_React$Component) { var tabIndexKey = selectedKeys[0]; var isExist = false; var treeNode = children && children.length && children[0]; - var eventKey = treeNode && treeNode.props.eventKey || treeNode.key; + var eventKey = treeNode && (treeNode.props.eventKey || treeNode.key); if (this.selectKeyDomExist && tabIndexKey || !tabIndexKey) { isExist = true; var queryInfo = 'a[pos="' + this.selectKeyDomPos + '"]'; @@ -1230,7 +1234,7 @@ var _initialiseProps = function _initialiseProps() { _this7.hasCalculateRowHeight = true; var rowHeight = treenodes.getBoundingClientRect().height; _this7.store.setState({ - rowHeight: rowHeight + rowHeight: rowHeight || 24 }); }; diff --git a/package.json b/package.json index 861132c..d752e23 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bee-tree", - "version": "2.1.30", + "version": "2.1.30-beta", "version-yonui": "2.1.27-yonui.0", "description": "Tree ui component for react", "keywords": [ diff --git a/src/Tree.js b/src/Tree.js index 22fef2b..4a7d0c6 100644 --- a/src/Tree.js +++ b/src/Tree.js @@ -185,7 +185,7 @@ class Tree extends React.Component { this.hasCalculateRowHeight = true; let rowHeight = treenodes.getBoundingClientRect().height; this.store.setState({ - rowHeight: rowHeight + rowHeight: rowHeight || 24 }); }