@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.
- package/es/hooks/useAlign.js +5 -0
- package/lib/hooks/useAlign.js +5 -0
- package/package.json +1 -1
package/es/hooks/useAlign.js
CHANGED
|
@@ -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;
|
package/lib/hooks/useAlign.js
CHANGED
|
@@ -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;
|