Skip to content

Commit

Permalink
fix(app): Fix scrolling behind long press modals (#16206)
Browse files Browse the repository at this point in the history
  • Loading branch information
smb2268 authored Sep 9, 2024
1 parent 877d5a5 commit eeb0eeb
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions app/src/atoms/MenuList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import {
BORDERS,
JUSTIFY_CENTER,
} from '@opentrons/components'
import { createPortal } from 'react-dom'
import { getTopPortalEl } from '../../App/portal'
import { LegacyModalShell } from '../../molecules/LegacyModal'

interface MenuListProps {
Expand All @@ -19,19 +21,22 @@ interface MenuListProps {
export const MenuList = (props: MenuListProps): JSX.Element | null => {
const { children, isOnDevice = false, onClick = null } = props
return isOnDevice && onClick != null ? (
<LegacyModalShell
borderRadius={BORDERS.borderRadius16}
width="max-content"
onOutsideClick={onClick}
>
<Flex
boxShadow={BORDERS.shadowSmall}
flexDirection={DIRECTION_COLUMN}
justifyContent={JUSTIFY_CENTER}
createPortal(
<LegacyModalShell
borderRadius={BORDERS.borderRadius16}
width="max-content"
onOutsideClick={onClick}
>
{children}
</Flex>
</LegacyModalShell>
<Flex
boxShadow={BORDERS.shadowSmall}
flexDirection={DIRECTION_COLUMN}
justifyContent={JUSTIFY_CENTER}
>
{children}
</Flex>
</LegacyModalShell>,
getTopPortalEl()
)
) : (
<Flex
borderRadius="4px 4px 0px 0px"
Expand Down

0 comments on commit eeb0eeb

Please sign in to comment.