mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-05-04 17:16:54 +08:00
fix(stage): scrollIntoView不能有横向滚动
This commit is contained in:
parent
9e263f9e23
commit
01f8040a1a
@ -155,10 +155,14 @@ export default class StageMask extends Rule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public scrollIntoView(el: Element): void {
|
public scrollIntoView(el: Element): void {
|
||||||
|
// 不可以有横向滚动
|
||||||
|
if (!this.page || el.getBoundingClientRect().left >= this.page.scrollWidth) return;
|
||||||
|
|
||||||
el.scrollIntoView();
|
el.scrollIntoView();
|
||||||
if (!this.pageScrollParent) return;
|
if (!this.pageScrollParent) return;
|
||||||
this.scrollLeft = this.pageScrollParent.scrollLeft;
|
this.scrollLeft = this.pageScrollParent.scrollLeft;
|
||||||
this.scrollTop = this.pageScrollParent.scrollTop;
|
this.scrollTop = this.pageScrollParent.scrollTop;
|
||||||
|
|
||||||
this.scroll();
|
this.scroll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user