From 632d62bcd3a739ad7827977ae20c4b6bbb50fc33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Tue, 16 Sep 2025 18:01:51 +0800 Subject: [PATCH 1/3] chore: ignore nest case --- src/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index b7063d63..0b73527d 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -336,8 +336,9 @@ export function generateTrigger( // Handle controlled state changes for UniqueProvider // Only sync to UniqueProvider when it's controlled mode + // If there is a parentContext, don't call uniqueContext methods useLayoutEffect(() => { - if (uniqueContext && unique && targetEle && !openUncontrolled) { + if (uniqueContext && unique && targetEle && !openUncontrolled && !parentContext) { if (mergedOpen) { Promise.resolve().then(() => { uniqueContext.show(getUniqueOptions(0)); @@ -384,7 +385,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 { From 17133cbcdc2bc699616fccc306e2351992a370e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Wed, 17 Sep 2025 15:23:37 +0800 Subject: [PATCH 2/3] chore: ignore if nest in --- src/index.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 0b73527d..6cc2aa4a 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -338,7 +338,13 @@ export function generateTrigger( // Only sync to UniqueProvider when it's controlled mode // If there is a parentContext, don't call uniqueContext methods useLayoutEffect(() => { - if (uniqueContext && unique && targetEle && !openUncontrolled && !parentContext) { + if ( + uniqueContext && + unique && + targetEle && + !openUncontrolled && + !parentContext + ) { if (mergedOpen) { Promise.resolve().then(() => { uniqueContext.show(getUniqueOptions(0)); @@ -347,7 +353,7 @@ export function generateTrigger( uniqueContext.hide(0); } } - }, [mergedOpen]); + }, [mergedOpen, targetEle]); const openRef = React.useRef(mergedOpen); openRef.current = mergedOpen; From 6b27101fc17821d59db1799088108c0bb8e4ead4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Wed, 17 Sep 2025 15:26:22 +0800 Subject: [PATCH 3/3] chore: not support getPopupContainer --- src/UniqueProvider/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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} >