@rc-component/trigger 3.6.0 → 3.6.1
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/UniqueProvider/index.js +2 -2
- package/es/index.js +5 -3
- package/lib/UniqueProvider/index.js +2 -2
- package/lib/index.js +5 -3
- package/package.json +1 -1
|
@@ -125,8 +125,8 @@ const UniqueProvider = ({
|
|
|
125
125
|
mask: options.mask,
|
|
126
126
|
arrow: options.arrow,
|
|
127
127
|
motion: options.popupMotion,
|
|
128
|
-
maskMotion: options.maskMotion
|
|
129
|
-
getPopupContainer
|
|
128
|
+
maskMotion: options.maskMotion
|
|
129
|
+
// getPopupContainer={options.getPopupContainer}
|
|
130
130
|
}, /*#__PURE__*/React.createElement(FloatBg, {
|
|
131
131
|
prefixCls: prefixCls,
|
|
132
132
|
isMobile: false,
|
package/es/index.js
CHANGED
|
@@ -177,8 +177,9 @@ export function generateTrigger(PortalComponent = Portal) {
|
|
|
177
177
|
|
|
178
178
|
// Handle controlled state changes for UniqueProvider
|
|
179
179
|
// Only sync to UniqueProvider when it's controlled mode
|
|
180
|
+
// If there is a parentContext, don't call uniqueContext methods
|
|
180
181
|
useLayoutEffect(() => {
|
|
181
|
-
if (uniqueContext && unique && targetEle && !openUncontrolled) {
|
|
182
|
+
if (uniqueContext && unique && targetEle && !openUncontrolled && !parentContext) {
|
|
182
183
|
if (mergedOpen) {
|
|
183
184
|
Promise.resolve().then(() => {
|
|
184
185
|
uniqueContext.show(getUniqueOptions(0));
|
|
@@ -187,7 +188,7 @@ export function generateTrigger(PortalComponent = Portal) {
|
|
|
187
188
|
uniqueContext.hide(0);
|
|
188
189
|
}
|
|
189
190
|
}
|
|
190
|
-
}, [mergedOpen]);
|
|
191
|
+
}, [mergedOpen, targetEle]);
|
|
191
192
|
const openRef = React.useRef(mergedOpen);
|
|
192
193
|
openRef.current = mergedOpen;
|
|
193
194
|
const lastTriggerRef = React.useRef([]);
|
|
@@ -218,7 +219,8 @@ export function generateTrigger(PortalComponent = Portal) {
|
|
|
218
219
|
}
|
|
219
220
|
|
|
220
221
|
// If UniqueContext exists and not controlled, pass delay to Provider instead of handling it internally
|
|
221
|
-
|
|
222
|
+
// If there is a parentContext, don't call uniqueContext methods
|
|
223
|
+
if (uniqueContext && unique && openUncontrolled && !parentContext) {
|
|
222
224
|
if (nextOpen) {
|
|
223
225
|
uniqueContext.show(getUniqueOptions(delay));
|
|
224
226
|
} else {
|
|
@@ -134,8 +134,8 @@ const UniqueProvider = ({
|
|
|
134
134
|
mask: options.mask,
|
|
135
135
|
arrow: options.arrow,
|
|
136
136
|
motion: options.popupMotion,
|
|
137
|
-
maskMotion: options.maskMotion
|
|
138
|
-
getPopupContainer
|
|
137
|
+
maskMotion: options.maskMotion
|
|
138
|
+
// getPopupContainer={options.getPopupContainer}
|
|
139
139
|
}, /*#__PURE__*/React.createElement(_FloatBg.default, {
|
|
140
140
|
prefixCls: prefixCls,
|
|
141
141
|
isMobile: false,
|
package/lib/index.js
CHANGED
|
@@ -192,8 +192,9 @@ function generateTrigger(PortalComponent = _portal.default) {
|
|
|
192
192
|
|
|
193
193
|
// Handle controlled state changes for UniqueProvider
|
|
194
194
|
// Only sync to UniqueProvider when it's controlled mode
|
|
195
|
+
// If there is a parentContext, don't call uniqueContext methods
|
|
195
196
|
(0, _useLayoutEffect.default)(() => {
|
|
196
|
-
if (uniqueContext && unique && targetEle && !openUncontrolled) {
|
|
197
|
+
if (uniqueContext && unique && targetEle && !openUncontrolled && !parentContext) {
|
|
197
198
|
if (mergedOpen) {
|
|
198
199
|
Promise.resolve().then(() => {
|
|
199
200
|
uniqueContext.show(getUniqueOptions(0));
|
|
@@ -202,7 +203,7 @@ function generateTrigger(PortalComponent = _portal.default) {
|
|
|
202
203
|
uniqueContext.hide(0);
|
|
203
204
|
}
|
|
204
205
|
}
|
|
205
|
-
}, [mergedOpen]);
|
|
206
|
+
}, [mergedOpen, targetEle]);
|
|
206
207
|
const openRef = React.useRef(mergedOpen);
|
|
207
208
|
openRef.current = mergedOpen;
|
|
208
209
|
const lastTriggerRef = React.useRef([]);
|
|
@@ -233,7 +234,8 @@ function generateTrigger(PortalComponent = _portal.default) {
|
|
|
233
234
|
}
|
|
234
235
|
|
|
235
236
|
// If UniqueContext exists and not controlled, pass delay to Provider instead of handling it internally
|
|
236
|
-
|
|
237
|
+
// If there is a parentContext, don't call uniqueContext methods
|
|
238
|
+
if (uniqueContext && unique && openUncontrolled && !parentContext) {
|
|
237
239
|
if (nextOpen) {
|
|
238
240
|
uniqueContext.show(getUniqueOptions(delay));
|
|
239
241
|
} else {
|