mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +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 {
|
||||
// 不可以有横向滚动
|
||||
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();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user