diff --git a/.changeset/curvy-cats-burn.md b/.changeset/curvy-cats-burn.md new file mode 100644 index 00000000000..2bd010c12ac --- /dev/null +++ b/.changeset/curvy-cats-burn.md @@ -0,0 +1,5 @@ +--- +'@shopify/polaris': patch +--- + +Page component: display subtitle even when it's the only header prop set diff --git a/polaris-react/src/components/Page/Page.tsx b/polaris-react/src/components/Page/Page.tsx index 9c3297111f6..b418d6e8b57 100644 --- a/polaris-react/src/components/Page/Page.tsx +++ b/polaris-react/src/components/Page/Page.tsx @@ -33,6 +33,7 @@ export function Page({ const hasHeaderContent = (rest.title != null && rest.title !== '') || + (rest.subtitle != null && rest.subtitle !== '') || rest.primaryAction != null || (rest.secondaryActions != null && ((isInterface(rest.secondaryActions) && diff --git a/polaris-react/src/components/Page/tests/Page.test.tsx b/polaris-react/src/components/Page/tests/Page.test.tsx index 96d8dcdbebe..337b2ea7e8f 100644 --- a/polaris-react/src/components/Page/tests/Page.test.tsx +++ b/polaris-react/src/components/Page/tests/Page.test.tsx @@ -58,7 +58,7 @@ describe('', () => { describe('subtitle', () => { it('gets passed into the
', () => { const subtitle = 'Subtitle'; - const page = mountWithApp(); + const page = mountWithApp(); expect(page).toContainReactComponent(Header, { subtitle, });