Tab事件
This commit is contained in:
parent
9c652dd562
commit
27cf462d1d
|
@ -80,7 +80,7 @@ class Demo2 extends Component{
|
|||
</TreeNode>
|
||||
);
|
||||
}
|
||||
return <TreeNode key={item.key} title={item.key} />;
|
||||
return <TreeNode key={item.key} title={item.key} isLeaf={true}/>;
|
||||
});
|
||||
return (
|
||||
<Tree
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -480,7 +480,7 @@ onExpand(treeNode,keyType) {
|
|||
}
|
||||
// all keyboard events callbacks run from here at first
|
||||
onKeyDown(e,treeNode) {
|
||||
event.preventDefault()
|
||||
// event.preventDefault()
|
||||
// console.log('-----'+e.keyCode);
|
||||
const props = this.props;
|
||||
const currentPos = treeNode.props.pos;
|
||||
|
@ -494,10 +494,10 @@ onExpand(treeNode,keyType) {
|
|||
}else if(e.keyCode == KeyCode.LEFT){
|
||||
// 收起树节点
|
||||
this.onExpand(treeNode,'left');
|
||||
}else if (e.keyCode == KeyCode.RIGHT){
|
||||
}else if (e.keyCode == KeyCode.RIGHT && !treeNode.props.isLeaf){
|
||||
// 展开树节点
|
||||
this.onExpand(treeNode,'right');
|
||||
}else if (e.keyCode == KeyCode.SPACE && props.checkable){
|
||||
}else if (e.keyCode == KeyCode.SPACE && props.checkable && !treeNode.props.isLeaf){
|
||||
// 如果是多选tree则进行选中或者反选该节点
|
||||
this.onCheck(treeNode);
|
||||
}
|
||||
|
|
|
@ -168,7 +168,7 @@ class TreeNode extends React.Component {
|
|||
// keyboard event support
|
||||
onKeyDown(e) {
|
||||
this.props.root.onKeyDown(e,this);
|
||||
e.preventDefault();
|
||||
// e.preventDefault();
|
||||
}
|
||||
|
||||
renderSwitcher(props, expandedState) {
|
||||
|
|
Loading…
Reference in New Issue