Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

Commit

Permalink
fix: Prevent backdrop from scrolling away (#106)
Browse files Browse the repository at this point in the history
* fix: Prevent backdrop from scrolling away

* fix: Add max-height to ModalContent and ModalBody to enable scrolling within the Modal
  • Loading branch information
gerrymi authored May 11, 2020
1 parent 4e8ba5a commit b5a285d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Modal/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const ModalContainer = createComponent({
const Backdrop = createComponent({
name: 'ModalBackdrop',
style: ({ transitionState }) => css`
position: absolute;
position: fixed;
top: 0;
left: 0;
width: 100%;
Expand Down Expand Up @@ -68,6 +68,7 @@ const ModalContent = createComponent({
background-clip: padding-box;
box-shadow: ${theme.shadow.hard};
border-radius: ${themeGet('radius')}px;
max-height: 90vh;
${transitionState === 'entering' &&
css`
Expand Down Expand Up @@ -223,6 +224,8 @@ Modal.Body = createComponent({
name: 'ModalBody',
style: css`
padding: 1.25rem;
height: calc(90vh - 105px);
overflow-y: auto;
`,
});

Expand Down

0 comments on commit b5a285d

Please sign in to comment.