@autobest-ui/components 2.0.5-y.1 → 2.0.5-y.2

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.
@@ -123,12 +123,18 @@ function (_super) {
123
123
 
124
124
  var element = _this.popupContentRef.current;
125
125
 
126
- if (element) {
127
- var activeElement = element.querySelector(".".concat(_this.prefixCls, "-active"));
128
- activeElement.scrollIntoView({
129
- block: 'nearest',
130
- inline: 'start'
131
- });
126
+ if (element && element.parentNode) {
127
+ var elementParentNode = element.parentNode;
128
+
129
+ if (elementParentNode) {
130
+ var activeElement = elementParentNode.querySelector(".".concat(_this.prefixCls, "-active"));
131
+
132
+ if (activeElement) {
133
+ // scrollIntoView有问题,设置block为start会带动全局的滚动条
134
+ elementParentNode.scrollTop = activeElement.offsetTop;
135
+ elementParentNode.scrollLeft = activeElement.offsetLeft;
136
+ }
137
+ }
132
138
  }
133
139
  });
134
140
  }
@@ -135,12 +135,18 @@ function (_super) {
135
135
 
136
136
  var element = _this.popupContentRef.current;
137
137
 
138
- if (element) {
139
- var activeElement = element.querySelector(".".concat(_this.prefixCls, "-active"));
140
- activeElement.scrollIntoView({
141
- block: 'nearest',
142
- inline: 'start'
143
- });
138
+ if (element && element.parentNode) {
139
+ var elementParentNode = element.parentNode;
140
+
141
+ if (elementParentNode) {
142
+ var activeElement = elementParentNode.querySelector(".".concat(_this.prefixCls, "-active"));
143
+
144
+ if (activeElement) {
145
+ // scrollIntoView有问题,设置block为start会带动全局的滚动条
146
+ elementParentNode.scrollTop = activeElement.offsetTop;
147
+ elementParentNode.scrollLeft = activeElement.offsetLeft;
148
+ }
149
+ }
144
150
  }
145
151
  });
146
152
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobest-ui/components",
3
- "version": "2.0.5-y.1",
3
+ "version": "2.0.5-y.2",
4
4
  "private": false,
5
5
  "description": "components common ui for React",
6
6
  "main": "lib/index.js",
@@ -46,5 +46,5 @@
46
46
  "react": ">=16.8.6",
47
47
  "react-transition-group": ">=4.2.2"
48
48
  },
49
- "gitHead": "b1bdd28e78a696af37cd63e3f13dd1f96e534ad7"
49
+ "gitHead": "922987f547f608a090e509ccec8cbecc58bb8935"
50
50
  }