fix(stage): scrollIntoView不能有横向滚动

This commit is contained in:
roymondchen 2024-01-18 19:47:50 +08:00
parent 9e263f9e23
commit 01f8040a1a

View File

@ -155,10 +155,14 @@ export default class StageMask extends Rule {
}
public scrollIntoView(el: Element): void {
// 不可以有横向滚动
if (!this.page || el.getBoundingClientRect().left >= this.page.scrollWidth) return;
el.scrollIntoView();
if (!this.pageScrollParent) return;
this.scrollLeft = this.pageScrollParent.scrollLeft;
this.scrollTop = this.pageScrollParent.scrollTop;
this.scroll();
}