diff --git a/src/UniqueProvider/index.tsx b/src/UniqueProvider/index.tsx index 6fc9a0c9..7f7625d1 100644 --- a/src/UniqueProvider/index.tsx +++ b/src/UniqueProvider/index.tsx @@ -173,7 +173,7 @@ const UniqueProvider = ({ children }: UniqueProviderProps) => { arrow={options.arrow} motion={options.popupMotion} maskMotion={options.maskMotion} - getPopupContainer={options.getPopupContainer} + // getPopupContainer={options.getPopupContainer} > { - if (uniqueContext && unique && targetEle && !openUncontrolled) { + if ( + uniqueContext && + unique && + targetEle && + !openUncontrolled && + !parentContext + ) { if (mergedOpen) { Promise.resolve().then(() => { uniqueContext.show(getUniqueOptions(0)); @@ -346,7 +353,7 @@ export function generateTrigger( uniqueContext.hide(0); } } - }, [mergedOpen]); + }, [mergedOpen, targetEle]); const openRef = React.useRef(mergedOpen); openRef.current = mergedOpen; @@ -384,7 +391,8 @@ export function generateTrigger( } // If UniqueContext exists and not controlled, pass delay to Provider instead of handling it internally - if (uniqueContext && unique && openUncontrolled) { + // If there is a parentContext, don't call uniqueContext methods + if (uniqueContext && unique && openUncontrolled && !parentContext) { if (nextOpen) { uniqueContext.show(getUniqueOptions(delay)); } else {