From ecdcf952e3b9c0d5660617c2709f9737028f6dce Mon Sep 17 00:00:00 2001 From: jameswilddev Date: Wed, 24 Nov 2021 15:11:03 +0000 Subject: [PATCH] Fix some cases where contents of padding overflowed bottom. --- components/createPaddingComponent/index.tsx | 2 ++ components/createPaddingComponent/unit.tsx | 31 ++++++++++++++------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/components/createPaddingComponent/index.tsx b/components/createPaddingComponent/index.tsx index 2e8e123d..b6929222 100644 --- a/components/createPaddingComponent/index.tsx +++ b/components/createPaddingComponent/index.tsx @@ -5,6 +5,7 @@ const globalStyles = StyleSheet.create({ containerFillingView: { width: `100%`, height: `100%`, + flex: 1, }, }); @@ -80,6 +81,7 @@ export const createPaddingComponent = ( contentFittingView, containerFillingView: { ...contentFittingView, + flex: 1, width: `100%`, height: `100%`, }, diff --git a/components/createPaddingComponent/unit.tsx b/components/createPaddingComponent/unit.tsx index bbe981d1..086a1eff 100644 --- a/components/createPaddingComponent/unit.tsx +++ b/components/createPaddingComponent/unit.tsx @@ -216,7 +216,10 @@ test(`renders container-filling with one zero`, () => { ); expect(unwrapRenderedFunctionComponent(rendered)).toEqual( - + Test Content ); @@ -233,7 +236,7 @@ test(`renders container-filling with one non-zero`, () => { expect(unwrapRenderedFunctionComponent(rendered)).toEqual( Test Content @@ -251,7 +254,10 @@ test(`renders container-filling with two zeroes`, () => { ); expect(unwrapRenderedFunctionComponent(rendered)).toEqual( - + Test Content ); @@ -268,7 +274,7 @@ test(`renders container-filling with one non-zero and one zero`, () => { expect(unwrapRenderedFunctionComponent(rendered)).toEqual( Test Content @@ -287,7 +293,7 @@ test(`renders container-filling with one zero and one non-zero`, () => { expect(unwrapRenderedFunctionComponent(rendered)).toEqual( Test Content @@ -309,6 +315,7 @@ test(`renders container-filling with two non-zeroes`, () => { style={{ width: `100%`, height: `100%`, + flex: 1, paddingVertical: 30, paddingHorizontal: 50, }} @@ -329,7 +336,10 @@ test(`renders container-filling with four zeroes`, () => { ); expect(unwrapRenderedFunctionComponent(rendered)).toEqual( - + Test Content ); @@ -346,7 +356,7 @@ test(`renders container-filling with non-zero top`, () => { expect(unwrapRenderedFunctionComponent(rendered)).toEqual( Test Content @@ -365,7 +375,7 @@ test(`renders container-filling with non-zero right`, () => { expect(unwrapRenderedFunctionComponent(rendered)).toEqual( Test Content @@ -384,7 +394,7 @@ test(`renders container-filling with non-zero bottom`, () => { expect(unwrapRenderedFunctionComponent(rendered)).toEqual( Test Content @@ -403,7 +413,7 @@ test(`renders container-filling with non-zero left`, () => { expect(unwrapRenderedFunctionComponent(rendered)).toEqual( Test Content @@ -425,6 +435,7 @@ test(`renders container-filling with four non-zeroes`, () => { style={{ width: `100%`, height: `100%`, + flex: 1, paddingTop: 30, paddingRight: 50, paddingBottom: 27,