@rc-component/trigger 1.4.0 → 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.
@@ -163,6 +163,11 @@ export default function useAlign(open, popupEle, target, placement, builtinPlace
163
163
  var _scaleX = toNum(Math.round(popupWidth / parseFloat(width) * 1000) / 1000);
164
164
  var _scaleY = toNum(Math.round(popupHeight / parseFloat(height) * 1000) / 1000);
165
165
 
166
+ // No need to align since it's not visible in view
167
+ if (_scaleX === 0 || _scaleY === 0) {
168
+ return;
169
+ }
170
+
166
171
  // Offset
167
172
  var offset = placementInfo.offset,
168
173
  targetOffset = placementInfo.targetOffset;
@@ -171,6 +171,11 @@ function useAlign(open, popupEle, target, placement, builtinPlacements, popupAli
171
171
  var _scaleX = toNum(Math.round(popupWidth / parseFloat(width) * 1000) / 1000);
172
172
  var _scaleY = toNum(Math.round(popupHeight / parseFloat(height) * 1000) / 1000);
173
173
 
174
+ // No need to align since it's not visible in view
175
+ if (_scaleX === 0 || _scaleY === 0) {
176
+ return;
177
+ }
178
+
174
179
  // Offset
175
180
  var offset = placementInfo.offset,
176
181
  targetOffset = placementInfo.targetOffset;
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.2",
4
4
  "description": "base abstract trigger component for react",
5
5
  "engines": {
6
6
  "node": ">=8.x"