This commit is contained in:
parent
bef6bc6512
commit
68bbbd134d
2 changed files with 2 additions and 0 deletions
|
@ -2091,6 +2091,7 @@ export class WYSIWYG {
|
|||
) {
|
||||
// 搜狗输入法不走 keydown,需重新记录历史状态
|
||||
if (range.toString() === "" && // windows 下回车新建块输入abc,选中 bc ctrl+m 后光标错误
|
||||
!this.preventKeyup &&
|
||||
nodeElement && typeof protyle.wysiwyg.lastHTMLs[nodeElement.getAttribute("data-node-id")] === "undefined") {
|
||||
range.insertNode(document.createElement("wbr"));
|
||||
protyle.wysiwyg.lastHTMLs[nodeElement.getAttribute("data-node-id")] = nodeElement.outerHTML;
|
||||
|
|
|
@ -175,6 +175,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
// 光标位于引用结尾后 ctrl+b 偶尔会失效
|
||||
range = cloneRange;
|
||||
// 会导致 protyle.toolbar.range 和 range 不一致,先在有问题的地方重置一下 https://github.com/siyuan-note/siyuan/issues/10933
|
||||
protyle.wysiwyg.preventKeyup = true; // 搜狗输入法进入此代码记录的话,keyup 就不再记录,否则 transaction 清空后 keyup 再次记录,下一次 keydown 就不会记录 https://github.com/siyuan-note/siyuan/issues/13244
|
||||
}
|
||||
|
||||
if (!window.siyuan.menus.menu.element.classList.contains("fn__none") &&
|
||||
|
|
Loading…
Add table
Reference in a new issue