@rc-component/trigger 1.5.2 → 1.5.3
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 +1 -1
- package/lib/hooks/useAlign.js +1 -1
- package/package.json +1 -1
package/es/hooks/useAlign.js
CHANGED
|
@@ -166,7 +166,7 @@ export default function useAlign(open, popupEle, target, placement, builtinPlace
|
|
|
166
166
|
var _scaleY = toNum(Math.round(popupHeight / parseFloat(height) * 1000) / 1000);
|
|
167
167
|
|
|
168
168
|
// No need to align since it's not visible in view
|
|
169
|
-
if (_scaleX === 0 || _scaleY === 0) {
|
|
169
|
+
if (_scaleX === 0 || _scaleY === 0 || target instanceof HTMLElement && !target.offsetParent) {
|
|
170
170
|
return;
|
|
171
171
|
}
|
|
172
172
|
|
package/lib/hooks/useAlign.js
CHANGED
|
@@ -174,7 +174,7 @@ function useAlign(open, popupEle, target, placement, builtinPlacements, popupAli
|
|
|
174
174
|
var _scaleY = toNum(Math.round(popupHeight / parseFloat(height) * 1000) / 1000);
|
|
175
175
|
|
|
176
176
|
// No need to align since it's not visible in view
|
|
177
|
-
if (_scaleX === 0 || _scaleY === 0) {
|
|
177
|
+
if (_scaleX === 0 || _scaleY === 0 || target instanceof HTMLElement && !target.offsetParent) {
|
|
178
178
|
return;
|
|
179
179
|
}
|
|
180
180
|
|