diff --git a/README.md b/README.md index 3fc5f8b4..381738dd 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ npm run build # 安装 -> 当前仓库版本:0.2.18,当前npm版本:0.2.18 +> 当前仓库版本:0.2.19,当前npm版本:0.2.19 ```bash npm i simple-mind-map diff --git a/index.html b/index.html index 0f942d52..34c8bdf3 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -一个简单的web思维导图实现
\ No newline at end of file +一个简单的web思维导图实现
\ No newline at end of file diff --git a/simple-mind-map/package.json b/simple-mind-map/package.json index 334d25ad..9d99df75 100644 --- a/simple-mind-map/package.json +++ b/simple-mind-map/package.json @@ -1,6 +1,6 @@ { "name": "simple-mind-map", - "version": "0.2.18", + "version": "0.2.19", "description": "一个简单的web在线思维导图", "authors": [ { diff --git a/simple-mind-map/src/KeyboardNavigation.js b/simple-mind-map/src/KeyboardNavigation.js index 03b08639..9b757a02 100644 --- a/simple-mind-map/src/KeyboardNavigation.js +++ b/simple-mind-map/src/KeyboardNavigation.js @@ -28,17 +28,17 @@ export default class KeyboardNavigation { * @Desc: 处理按键事件 */ onKeyup(e) { - if (this.mindMap.renderer.activeNodeList.length > 0) { - ;['Left', 'Up', 'Right', 'Down'].forEach(dir => { - if (isKey(e, dir)) { + ;['Left', 'Up', 'Right', 'Down'].forEach(dir => { + if (isKey(e, dir)) { + if (this.mindMap.renderer.activeNodeList.length > 0) { this.focus(dir) + } else { + let root = this.mindMap.renderer.root + this.mindMap.renderer.moveNodeToCenter(root) + root.active() } - }) - } else { - let root = this.mindMap.renderer.root - this.mindMap.renderer.moveNodeToCenter(root) - root.active() - } + } + }) } /**