mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-04 15:58:49 +01:00
This commit is contained in:
parent
081cb8b1cc
commit
3fb7929604
1 changed files with 6 additions and 1 deletions
|
|
@ -614,7 +614,12 @@ export class Toolbar {
|
|||
this.range.collapse(true);
|
||||
} else {
|
||||
if (lastNewNode.lastChild) {
|
||||
this.range.setEnd(lastNewNode.lastChild, lastNewNode.lastChild.textContent.length);
|
||||
if (lastNewNode.lastChild.textContent === Constants.ZWSP) {
|
||||
// 新建元素时光标消失 https://github.com/siyuan-note/siyuan/issues/6481
|
||||
this.range.collapse();
|
||||
} else {
|
||||
this.range.setEnd(lastNewNode.lastChild, lastNewNode.lastChild.textContent.length);
|
||||
}
|
||||
} else if (lastNewNode.nodeType === 3) {
|
||||
this.range.setEnd(lastNewNode, lastNewNode.textContent.length);
|
||||
if (lastNewNode.textContent === Constants.ZWSP) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue