@rc-component/trigger 1.4.1 → 1.4.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.
@@ -145,11 +145,6 @@ export default function useAlign(open, popupEle, target, placement, builtinPlace
145
145
  eleInnerWidth = ele.clientWidth;
146
146
  var scaleX = toNum(Math.round(eleRect.width / eleOutWidth * 1000) / 1000);
147
147
  var scaleY = toNum(Math.round(eleRect.height / eleOutHeight * 1000) / 1000);
148
-
149
- // No need to align since it's not visible in view
150
- if (scaleX === 0 || scaleY === 0) {
151
- return;
152
- }
153
148
  var eleScrollWidth = (eleOutWidth - eleInnerWidth) * scaleX;
154
149
  var eleScrollHeight = (eleOutHeight - eleInnerHeight) * scaleY;
155
150
  var eleRight = eleRect.x + eleRect.width - eleScrollWidth;
@@ -168,6 +163,11 @@ export default function useAlign(open, popupEle, target, placement, builtinPlace
168
163
  var _scaleX = toNum(Math.round(popupWidth / parseFloat(width) * 1000) / 1000);
169
164
  var _scaleY = toNum(Math.round(popupHeight / parseFloat(height) * 1000) / 1000);
170
165
 
166
+ // No need to align since it's not visible in view
167
+ if (_scaleX === 0 || _scaleY === 0) {
168
+ return;
169
+ }
170
+
171
171
  // Offset
172
172
  var offset = placementInfo.offset,
173
173
  targetOffset = placementInfo.targetOffset;
@@ -153,11 +153,6 @@ function useAlign(open, popupEle, target, placement, builtinPlacements, popupAli
153
153
  eleInnerWidth = ele.clientWidth;
154
154
  var scaleX = toNum(Math.round(eleRect.width / eleOutWidth * 1000) / 1000);
155
155
  var scaleY = toNum(Math.round(eleRect.height / eleOutHeight * 1000) / 1000);
156
-
157
- // No need to align since it's not visible in view
158
- if (scaleX === 0 || scaleY === 0) {
159
- return;
160
- }
161
156
  var eleScrollWidth = (eleOutWidth - eleInnerWidth) * scaleX;
162
157
  var eleScrollHeight = (eleOutHeight - eleInnerHeight) * scaleY;
163
158
  var eleRight = eleRect.x + eleRect.width - eleScrollWidth;
@@ -176,6 +171,11 @@ function useAlign(open, popupEle, target, placement, builtinPlacements, popupAli
176
171
  var _scaleX = toNum(Math.round(popupWidth / parseFloat(width) * 1000) / 1000);
177
172
  var _scaleY = toNum(Math.round(popupHeight / parseFloat(height) * 1000) / 1000);
178
173
 
174
+ // No need to align since it's not visible in view
175
+ if (_scaleX === 0 || _scaleY === 0) {
176
+ return;
177
+ }
178
+
179
179
  // Offset
180
180
  var offset = placementInfo.offset,
181
181
  targetOffset = placementInfo.targetOffset;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rc-component/trigger",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "base abstract trigger component for react",
5
5
  "engines": {
6
6
  "node": ">=8.x"