This commit is contained in:
parent
86d2d1047d
commit
4de3649673
1 changed files with 8 additions and 8 deletions
|
@ -736,14 +736,14 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
} else if (nodeEditableElement?.innerText.substr(position.end).indexOf("\n") === -1 || position.end >= nodeEditableElement.innerText.trimEnd().length) {
|
||||
// 需使用 innerText,否则 td 中的 br 无法转换为 \n; position.end 不能加1,否则倒数第二行行末无法下移
|
||||
range.collapse(false);
|
||||
const nextFoldElement = getNextBlock(nodeElement) as HTMLElement;
|
||||
if (nextFoldElement) {
|
||||
if(nodeEditableElement.getBoundingClientRect().bottom - getSelectionPosition(nodeElement, range).top < 40) {
|
||||
focusBlock(nextFoldElement);
|
||||
scrollCenter(protyle, nextFoldElement);
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
}
|
||||
const nextElement = getNextBlock(nodeElement) as HTMLElement;
|
||||
if (nextElement &&
|
||||
(nextElement.getAttribute("fold") === "1" || nextElement.classList.contains("code-block")) &&
|
||||
nodeEditableElement.getBoundingClientRect().bottom - getSelectionPosition(nodeElement, range).top < 40) {
|
||||
focusBlock(nextElement);
|
||||
scrollCenter(protyle, nextElement);
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue