Skip to content

Commit 17133cb

Browse files
committed
chore: ignore if nest in
1 parent 632d62b commit 17133cb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/index.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,13 @@ export function generateTrigger(
338338
// Only sync to UniqueProvider when it's controlled mode
339339
// If there is a parentContext, don't call uniqueContext methods
340340
useLayoutEffect(() => {
341-
if (uniqueContext && unique && targetEle && !openUncontrolled && !parentContext) {
341+
if (
342+
uniqueContext &&
343+
unique &&
344+
targetEle &&
345+
!openUncontrolled &&
346+
!parentContext
347+
) {
342348
if (mergedOpen) {
343349
Promise.resolve().then(() => {
344350
uniqueContext.show(getUniqueOptions(0));
@@ -347,7 +353,7 @@ export function generateTrigger(
347353
uniqueContext.hide(0);
348354
}
349355
}
350-
}, [mergedOpen]);
356+
}, [mergedOpen, targetEle]);
351357

352358
const openRef = React.useRef(mergedOpen);
353359
openRef.current = mergedOpen;

0 commit comments

Comments
 (0)