This commit is contained in:
Vanessa 2022-06-06 15:52:50 +08:00
parent 009b781e2f
commit 90b8de3b10

View File

@ -141,8 +141,10 @@ const setHTML = (options: { content: string, action?: string[] }, protyle: IProt
if (!options.action.includes(Constants.CB_GET_UNUNDO)) { if (!options.action.includes(Constants.CB_GET_UNUNDO)) {
pushBack(protyle, undefined, focusElement); pushBack(protyle, undefined, focusElement);
} }
focusElement.scrollIntoView();
// 减少抖动 https://ld246.com/article/1654263598088
setTimeout(() => { setTimeout(() => {
scrollCenter(protyle, focusElement, true); focusElement.scrollIntoView();
}, Constants.TIMEOUT_BLOCKLOAD); }, Constants.TIMEOUT_BLOCKLOAD);
} else { } else {
focusBlock(protyle.wysiwyg.element.firstElementChild); focusBlock(protyle.wysiwyg.element.firstElementChild);