Skip to content

Commit 2a11585

Browse files
committed
ensure dropdown popover renders within the Dash app
1 parent 7eebb4e commit 2a11585

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

components/dash-core-components/src/fragments/Dropdown.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,12 @@ const Dropdown = (props: DropdownProps) => {
420420
</button>
421421
</Popover.Trigger>
422422

423-
<Popover.Portal>
423+
<Popover.Portal
424+
// container is required otherwise popover will be rendered
425+
// at document root, which may be outside of the Dash app (i.e.
426+
// an embedded app)
427+
container={dropdownContainerRef.current?.parentElement}
428+
>
424429
<Popover.Content
425430
ref={dropdownContentRef}
426431
className="dash-dropdown-content"

0 commit comments

Comments
 (0)