Skip to content

Commit

Permalink
🐛 fix #1289 (#1314)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lagrange1813 committed Oct 21, 2022
1 parent 77da4c8 commit ed9e0da
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ts/util/fixBrowserBehavior.ts
Expand Up @@ -49,6 +49,10 @@ export const fixCJKPosition = (range: Range, vditor: IVditor, event: KeyboardEve
const pLiElement = hasClosestByMatchTag(range.startContainer, "P") ||
hasClosestByMatchTag(range.startContainer, "LI");
if (pLiElement && getSelectPosition(pLiElement, vditor[vditor.currentMode].element, range).start === 0) {

// https://github.com/Vanessa219/vditor/issues/1289 WKWebView切换输入法产生六分之一空格,造成光标错位
pLiElement.nodeValue = pLiElement.nodeValue.replace(/\u2006/g, '');

const zwspNode = document.createTextNode(Constants.ZWSP);
range.insertNode(zwspNode);
range.setStartAfter(zwspNode);
Expand Down

0 comments on commit ed9e0da

Please sign in to comment.