Skip to content

Commit

Permalink
🐛 fix #400
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed May 13, 2020
1 parent 5e0b079 commit 585c8a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 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.5 / 2020-05-xx

* [400](https://github.com/Vanessa219/vditor/issues/400) Heading(wysiwyg) windows firefox `修复缺陷`
* [401](https://github.com/Vanessa219/vditor/issues/401) render demo(mobile) `改进功能`

### v3.2.4 / 2020-05-12
Expand Down
9 changes: 7 additions & 2 deletions src/ts/util/selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,13 @@ export const setRangeByWbr = (element: HTMLElement, range: Range) => {
// text<wbr>
range.setStart(wbrElement.previousSibling, wbrElement.previousSibling.textContent.length);
} else if (wbrElement.nextSibling) {
// <wbr>text
range.setStart(wbrElement.nextSibling, 0);
if (wbrElement.nextSibling.nodeType === 3) {
// <wbr>text
range.setStart(wbrElement.nextSibling, 0);
} else {
// <wbr><br> https://github.com/Vanessa219/vditor/issues/400
range.setStartBefore(wbrElement.nextSibling);
}
} else {
// 内容为空
range.setStart(wbrElement.parentElement, 0);
Expand Down

0 comments on commit 585c8a9

Please sign in to comment.