Skip to content

Commit

Permalink
🐛 fix #409
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed May 19, 2020
1 parent a55eaf3 commit 7f77e0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@

### v3.2.8 / 2020-05-xx

* [409](https://github.com/Vanessa219/vditor/issues/409) codeblock(mac safari) `修复缺陷`
* [407](https://github.com/Vanessa219/vditor/issues/407) cursor moving at tables(safari & firefox) `修复缺陷`

### v3.2.7 / 2020-05-17
Expand Down
3 changes: 3 additions & 0 deletions src/ts/util/fixBrowserBehavior.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export const insertAfterBlock = (vditor: IVditor, event: KeyboardEvent, range: R
} else {
range.selectNodeContents(nextElement);
range.collapse(true);
setSelectionFocus(range);
}
event.preventDefault();
return true;
Expand All @@ -146,6 +147,7 @@ export const insertBeforeBlock = (vditor: IVditor, event: KeyboardEvent, range:
} else {
range.selectNodeContents(previousElement);
range.collapse(false);
setSelectionFocus(range);
}
event.preventDefault();
return true;
Expand Down Expand Up @@ -890,6 +892,7 @@ export const fixCodeBlock = (vditor: IVditor, event: KeyboardEvent, codeRenderEl
}
range.insertNode(document.createTextNode("\n"));
range.collapse(false);
setSelectionFocus(range);
execAfterRender(vditor);
scrollCenter(vditor);
event.preventDefault();
Expand Down

0 comments on commit 7f77e0f

Please sign in to comment.