Vanessa 2025-09-13 09:15:06 +08:00
parent 2ff8c148bd
commit b70328c7e7
3 changed files with 9 additions and 0 deletions

View file

@ -154,6 +154,10 @@ const afterRenderGallery = (options: ITableOptions) => {
if (typeof options.resetData.oldOffset === "number") {
options.protyle.contentElement.scrollTop = options.resetData.oldOffset;
}
if (options.blockElement.getAttribute("data-need-focus") === 'true') {
focusBlock(options.blockElement);
options.blockElement.removeAttribute("data-need-focus");
}
options.blockElement.setAttribute("data-render", "true");
if (options.resetData.alignSelf) {
options.blockElement.style.alignSelf = options.resetData.alignSelf;

View file

@ -282,6 +282,10 @@ const renderGroupTable = (options: ITableOptions) => {
};
const afterRenderTable = (options: ITableOptions) => {
if (options.blockElement.getAttribute("data-need-focus") === 'true') {
focusBlock(options.blockElement);
options.blockElement.removeAttribute("data-need-focus");
}
options.blockElement.setAttribute("data-render", "true");
options.blockElement.querySelector(".av__scroll").scrollLeft = options.resetData.left;
options.blockElement.style.alignSelf = options.resetData.alignSelf;

View file

@ -610,6 +610,7 @@ export const focusBlock = (element: Element, parentElement?: HTMLElement, toStar
range.setStart(cursorElement.firstChild, 0);
setRange = true;
} else {
element.setAttribute("data-need-focus", "true");
return false;
}
/// #else