@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.
@@ -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
 
@@ -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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rc-component/trigger",
3
- "version": "1.5.2",
3
+ "version": "1.5.3",
4
4
  "description": "base abstract trigger component for react",
5
5
  "engines": {
6
6
  "node": ">=8.x"