@rc-component/trigger 1.4.0 → 1.4.1

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,6 +145,11 @@ 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
+ }
148
153
  var eleScrollWidth = (eleOutWidth - eleInnerWidth) * scaleX;
149
154
  var eleScrollHeight = (eleOutHeight - eleInnerHeight) * scaleY;
150
155
  var eleRight = eleRect.x + eleRect.width - eleScrollWidth;
@@ -153,6 +153,11 @@ 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
+ }
156
161
  var eleScrollWidth = (eleOutWidth - eleInnerWidth) * scaleX;
157
162
  var eleScrollHeight = (eleOutHeight - eleInnerHeight) * scaleY;
158
163
  var eleRight = eleRect.x + eleRect.width - eleScrollWidth;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rc-component/trigger",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "base abstract trigger component for react",
5
5
  "engines": {
6
6
  "node": ">=8.x"