Skip to content

Commit

Permalink
🐛 fix #82
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Jan 21, 2020
1 parent 9c2dcf8 commit c166638
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

### v2.1.2 / 2020-01-20

* [82](https://github.com/Vanessa219/vditor/issues/82) 文字拖动 `改进功能`
* [82](https://github.com/Vanessa219/vditor/issues/82) 文字拖动 `修复缺陷`
* [74](https://github.com/Vanessa219/vditor/issues/74) anchor 中移除 . `改进功能`
* [75](https://github.com/Vanessa219/vditor/issues/75) 表格输入自动完成优化 `改进功能`
* [73](https://github.com/Vanessa219/vditor/issues/73) 添加链接卡片样式 `引入特性`
Expand Down
2 changes: 1 addition & 1 deletion demo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import '../src/assets/scss/classic.scss'

window.vditor = new Vditor('vditor', {
debugger: true,
typewriterMode: false,
typewriterMode: true,
placeholder: 'placeholder',
counter: 100,
height: 500,
Expand Down
3 changes: 1 addition & 2 deletions src/ts/wysiwyg/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {Constants} from "../constants";
import {getSelectPosition} from "../editor/getSelectPosition";
import {setSelectionByPosition, setSelectionFocus} from "../editor/setSelection";
import {uploadFiles} from "../upload";
import {focusEvent, hotkeyEvent, scrollCenter, selectEvent} from "../util/editorCommenEvent";
import {focusEvent, hotkeyEvent, selectEvent} from "../util/editorCommenEvent";
import {
hasClosestBlock,
hasClosestByClassName,
Expand All @@ -17,7 +17,6 @@ import {highlightToolbar} from "./highlightToolbar";
import {input} from "./input";
import {insertHTML} from "./insertHTML";
import {processCodeRender} from "./processCodeRender";
import {setRangeByWbr} from "./setRangeByWbr";

class WYSIWYG {
public element: HTMLPreElement;
Expand Down
6 changes: 5 additions & 1 deletion src/ts/wysiwyg/processKeydown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -527,5 +527,9 @@ export const processKeydown = (vditor: IVditor, event: KeyboardEvent) => {
return true;
}

if (event.key === "Enter") {
scrollCenter(vditor.wysiwyg.element);
}

return false;
};
}

0 comments on commit c166638

Please sign in to comment.