mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-25 00:14:07 +01:00
🚨
This commit is contained in:
parent
e80354ebbb
commit
5cdcd27faa
7 changed files with 10 additions and 10 deletions
|
|
@ -45,7 +45,7 @@ export const saveScroll = (protyle: IProtyle, getObject = false) => {
|
|||
setStorageVal(Constants.LOCAL_FILEPOSITION, window.siyuan.storage[Constants.LOCAL_FILEPOSITION], () => {
|
||||
resolve(true);
|
||||
});
|
||||
})
|
||||
});
|
||||
};
|
||||
|
||||
export const getDocByScroll = (options: {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import * as dayjs from "dayjs";
|
|||
import {transaction, updateTransaction} from "./transaction";
|
||||
import {mathRender} from "../render/mathRender";
|
||||
import {highlightRender} from "../render/highlightRender";
|
||||
import {getContenteditableElement, getNextBlock, hasNextSibling, isNotEditBlock} from "./getBlock";
|
||||
import {getContenteditableElement, hasNextSibling, isNotEditBlock} from "./getBlock";
|
||||
import {genEmptyBlock} from "../../block/util";
|
||||
import {blockRender} from "../render/blockRender";
|
||||
import {hideElements} from "../ui/hideElements";
|
||||
|
|
|
|||
|
|
@ -735,7 +735,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
event.preventDefault();
|
||||
} 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)
|
||||
range.collapse(false);
|
||||
const nextFoldElement = getNextBlock(nodeElement) as HTMLElement;
|
||||
if (nextFoldElement) {
|
||||
if(nodeEditableElement.getBoundingClientRect().bottom - getSelectionPosition(nodeElement, range).top < 40) {
|
||||
|
|
@ -844,7 +844,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
}
|
||||
if (nextSibling.nodeType === 1 && nextSibling.classList.contains("img")) {
|
||||
// 光标需在图片前 https://github.com/siyuan-note/siyuan/issues/12452
|
||||
const textPosition = getSelectionOffset(range.startContainer, protyle.wysiwyg.element, range)
|
||||
const textPosition = getSelectionOffset(range.startContainer, protyle.wysiwyg.element, range);
|
||||
if (textPosition.start === range.startContainer.textContent.length) {
|
||||
removeImage(nextSibling as Element, nodeElement, range, protyle);
|
||||
event.stopPropagation();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue