@tmagic/stage 1.3.12 → 1.3.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2115,6 +2115,8 @@ class StageMask extends Rule {
2115
2115
  this.setMode(isFixedParent(el) ? Mode.FIXED : Mode.ABSOLUTE);
2116
2116
  }
2117
2117
  scrollIntoView(el) {
2118
+ if (!this.page || el.getBoundingClientRect().left >= this.page.scrollWidth)
2119
+ return;
2118
2120
  el.scrollIntoView();
2119
2121
  if (!this.pageScrollParent)
2120
2122
  return;
@@ -2112,6 +2112,8 @@
2112
2112
  this.setMode(isFixedParent(el) ? Mode.FIXED : Mode.ABSOLUTE);
2113
2113
  }
2114
2114
  scrollIntoView(el) {
2115
+ if (!this.page || el.getBoundingClientRect().left >= this.page.scrollWidth)
2116
+ return;
2115
2117
  el.scrollIntoView();
2116
2118
  if (!this.pageScrollParent)
2117
2119
  return;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.3.12",
2
+ "version": "1.3.14",
3
3
  "name": "@tmagic/stage",
4
4
  "type": "module",
5
5
  "sideEffects": [
@@ -26,9 +26,9 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@scena/guides": "^0.29.2",
29
- "@tmagic/core": "1.3.12",
30
- "@tmagic/schema": "1.3.12",
31
- "@tmagic/utils": "1.3.12",
29
+ "@tmagic/core": "1.3.14",
30
+ "@tmagic/schema": "1.3.14",
31
+ "@tmagic/utils": "1.3.14",
32
32
  "events": "^3.3.0",
33
33
  "keycon": "^1.4.0",
34
34
  "lodash-es": "^4.17.21",
package/src/StageMask.ts CHANGED
@@ -155,10 +155,14 @@ export default class StageMask extends Rule {
155
155
  }
156
156
 
157
157
  public scrollIntoView(el: Element): void {
158
+ // 不可以有横向滚动
159
+ if (!this.page || el.getBoundingClientRect().left >= this.page.scrollWidth) return;
160
+
158
161
  el.scrollIntoView();
159
162
  if (!this.pageScrollParent) return;
160
163
  this.scrollLeft = this.pageScrollParent.scrollLeft;
161
164
  this.scrollTop = this.pageScrollParent.scrollTop;
165
+
162
166
  this.scroll();
163
167
  }
164
168