Fix SQL search results centering (#16290)

* 🎨 Refactor `highlightById` and `scrollCenter` functions to support position options

* 🎨 Fix SQL search results centering

fix https://github.com/siyuan-note/siyuan/issues/16279
This commit is contained in:
Jeffrey Chen 2025-11-09 10:46:35 +08:00 committed by GitHub
parent c0e947d2ac
commit 8d6c422af0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 50 additions and 25 deletions

View file

@ -333,7 +333,7 @@ export const insertHTML = (html: string, protyle: IProtyle, isBlock = false,
blockElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));
updateTransaction(protyle, id, blockElement.outerHTML, oldHTML);
setTimeout(() => {
scrollCenter(protyle, blockElement, false, "smooth");
scrollCenter(protyle, blockElement, {behavior: "smooth"});
}, Constants.TIMEOUT_LOAD);
return;
}