@rc-component/trigger 1.18.1 → 1.18.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 +3 -0
- package/lib/hooks/useAlign.js +3 -0
- package/package.json +1 -1
package/es/hooks/useAlign.js
CHANGED
|
@@ -118,6 +118,7 @@ export default function useAlign(open, popupEle, target, placement, builtinPlace
|
|
|
118
118
|
var originTop = popupElement.style.top;
|
|
119
119
|
var originRight = popupElement.style.right;
|
|
120
120
|
var originBottom = popupElement.style.bottom;
|
|
121
|
+
var originOverflow = popupElement.style.overflow;
|
|
121
122
|
|
|
122
123
|
// Placement
|
|
123
124
|
var placementInfo = _objectSpread(_objectSpread({}, builtinPlacements[placement]), popupAlign);
|
|
@@ -136,6 +137,7 @@ export default function useAlign(open, popupEle, target, placement, builtinPlace
|
|
|
136
137
|
popupElement.style.top = '0';
|
|
137
138
|
popupElement.style.right = 'auto';
|
|
138
139
|
popupElement.style.bottom = 'auto';
|
|
140
|
+
popupElement.style.overflow = 'hidden';
|
|
139
141
|
|
|
140
142
|
// Calculate align style, we should consider `transform` case
|
|
141
143
|
var targetRect;
|
|
@@ -208,6 +210,7 @@ export default function useAlign(open, popupEle, target, placement, builtinPlace
|
|
|
208
210
|
popupElement.style.top = originTop;
|
|
209
211
|
popupElement.style.right = originRight;
|
|
210
212
|
popupElement.style.bottom = originBottom;
|
|
213
|
+
popupElement.style.overflow = originOverflow;
|
|
211
214
|
(_popupElement$parentE2 = popupElement.parentElement) === null || _popupElement$parentE2 === void 0 || _popupElement$parentE2.removeChild(placeholderElement);
|
|
212
215
|
|
|
213
216
|
// Calculate scale
|
package/lib/hooks/useAlign.js
CHANGED
|
@@ -126,6 +126,7 @@ function useAlign(open, popupEle, target, placement, builtinPlacements, popupAli
|
|
|
126
126
|
var originTop = popupElement.style.top;
|
|
127
127
|
var originRight = popupElement.style.right;
|
|
128
128
|
var originBottom = popupElement.style.bottom;
|
|
129
|
+
var originOverflow = popupElement.style.overflow;
|
|
129
130
|
|
|
130
131
|
// Placement
|
|
131
132
|
var placementInfo = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, builtinPlacements[placement]), popupAlign);
|
|
@@ -144,6 +145,7 @@ function useAlign(open, popupEle, target, placement, builtinPlacements, popupAli
|
|
|
144
145
|
popupElement.style.top = '0';
|
|
145
146
|
popupElement.style.right = 'auto';
|
|
146
147
|
popupElement.style.bottom = 'auto';
|
|
148
|
+
popupElement.style.overflow = 'hidden';
|
|
147
149
|
|
|
148
150
|
// Calculate align style, we should consider `transform` case
|
|
149
151
|
var targetRect;
|
|
@@ -216,6 +218,7 @@ function useAlign(open, popupEle, target, placement, builtinPlacements, popupAli
|
|
|
216
218
|
popupElement.style.top = originTop;
|
|
217
219
|
popupElement.style.right = originRight;
|
|
218
220
|
popupElement.style.bottom = originBottom;
|
|
221
|
+
popupElement.style.overflow = originOverflow;
|
|
219
222
|
(_popupElement$parentE2 = popupElement.parentElement) === null || _popupElement$parentE2 === void 0 || _popupElement$parentE2.removeChild(placeholderElement);
|
|
220
223
|
|
|
221
224
|
// Calculate scale
|