This commit is contained in:
Vanessa 2023-01-16 00:00:53 +08:00
parent 968bcd433e
commit 62cf6411a0
7 changed files with 14 additions and 15 deletions

View file

@ -457,8 +457,8 @@ export const resizeTabs = () => {
}
// 保持光标位置不变 https://ld246.com/article/1673704873983/comment/1673765814595#comments
if (!item.element.classList.contains("fn__none") && item.editor.protyle.toolbar.range) {
const protyleRect = item.editor.protyle.element.getBoundingClientRect()
const rangeRect = item.editor.protyle.toolbar.range.getBoundingClientRect()
const protyleRect = item.editor.protyle.element.getBoundingClientRect();
const rangeRect = item.editor.protyle.toolbar.range.getBoundingClientRect();
if (protyleRect.top + 30 > rangeRect.top || protyleRect.bottom < rangeRect.bottom) {
item.editor.protyle.toolbar.range.startContainer.parentElement.scrollIntoView(protyleRect.top > rangeRect.top);
}