From 3e344ec4e61428840cdae270e3b6e5bd41a5a744 Mon Sep 17 00:00:00 2001 From: Kyle Durand Date: Tue, 10 Jan 2023 14:59:00 -0500 Subject: [PATCH 1/2] Fix modal scroll bug --- .changeset/pretty-drinks-tie.md | 5 +++++ polaris-react/src/components/Modal/Modal.tsx | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/pretty-drinks-tie.md diff --git a/.changeset/pretty-drinks-tie.md b/.changeset/pretty-drinks-tie.md new file mode 100644 index 00000000000..b2a78c5eff1 --- /dev/null +++ b/.changeset/pretty-drinks-tie.md @@ -0,0 +1,5 @@ +--- +'@shopify/polaris': patch +--- + +Fixed modal scroll bug diff --git a/polaris-react/src/components/Modal/Modal.tsx b/polaris-react/src/components/Modal/Modal.tsx index b656747fdb2..e75db6efca2 100644 --- a/polaris-react/src/components/Modal/Modal.tsx +++ b/polaris-react/src/components/Modal/Modal.tsx @@ -165,7 +165,9 @@ export const Modal: React.FunctionComponent & { ); const scrollContainerMarkup = noScroll ? ( - {body} + + {body} + ) : ( Date: Tue, 10 Jan 2023 16:45:31 -0500 Subject: [PATCH 2/2] Improve story content --- .../src/components/Modal/Modal.stories.tsx | 98 ++++++++++++------- 1 file changed, 64 insertions(+), 34 deletions(-) diff --git a/polaris-react/src/components/Modal/Modal.stories.tsx b/polaris-react/src/components/Modal/Modal.stories.tsx index 02b80b02d90..3e0dc05798a 100644 --- a/polaris-react/src/components/Modal/Modal.stories.tsx +++ b/polaris-react/src/components/Modal/Modal.stories.tsx @@ -6,7 +6,6 @@ import { Checkbox, ChoiceList, DropZone, - Form, FormLayout, Modal, Stack, @@ -490,29 +489,44 @@ export function WithLongContent() { title="Long form modal" open onClose={() => {}} - sectioned primaryAction={{content: 'Save'}} > - -
{}}> + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - +
); } @@ -527,26 +541,42 @@ export function WithLongContentNoScroll() { noScroll primaryAction={{content: 'Save'}} > - -
{}}> + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - +
); }