Skip to content

Commit 58d63de

Browse files
committed
Prevent popovers from rendering clipped outside of Dash app (embedded apps)
1 parent d76d25b commit 58d63de

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,9 @@ const DatePickerRange = ({
384384
className="dash-datepicker-content"
385385
align="start"
386386
sideOffset={5}
387+
collisionBoundary={containerRef.current?.closest(
388+
'#_dash-app-content'
389+
)}
387390
onOpenAutoFocus={e => e.preventDefault()}
388391
onCloseAutoFocus={e => {
389392
e.preventDefault();

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ const DatePickerSingle = ({
203203
className="dash-datepicker-content"
204204
align="start"
205205
sideOffset={5}
206+
collisionBoundary={containerRef.current?.closest(
207+
'#_dash-app-content'
208+
)}
206209
onOpenAutoFocus={e => e.preventDefault()}
207210
onCloseAutoFocus={e => {
208211
e.preventDefault();

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,9 @@ const Dropdown = (props: DropdownProps) => {
458458
className="dash-dropdown-content"
459459
align="start"
460460
sideOffset={5}
461+
collisionBoundary={positioningContainerRef.current?.closest(
462+
'#_dash-app-content'
463+
)}
461464
onOpenAutoFocus={e => e.preventDefault()}
462465
onKeyDown={handleKeyDown}
463466
style={{

0 commit comments

Comments
 (0)