Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components/layout/header/page-header/PageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,13 @@ const StyledPageHeader = styled(StyledHeaderBase)`
${cssVar('layout-page-header-sizes-height-collapsed')} - var(--page-header-total-height) -
${cssVar('dimension-space-300')}
);
z-index: 1;
}

&[data-scroll-behavior='${PageHeaderScrollBehavior.sticky}'] {
position: sticky;
top: 0;
z-index: 1;
}
`;
StyledPageHeader.displayName = 'StyledPageHeader';
11 changes: 11 additions & 0 deletions stories/layout/Layout-stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {
LinkStandalone,
LogoSonarQubeServer,
Text,
TextInput,
} from '../../src';
import { AsideSize } from '../../src/components/layout/LayoutTypes';
import { PageHeaderScrollBehavior } from '../../src/components/layout/header/common/HeaderTypes';
Expand Down Expand Up @@ -158,6 +159,7 @@ export const Default: Story = {

<Layout.PageGrid width={args.pageWidth}>
{args.pageHeader(args.pageHeaderScrollBehavior)}

<Layout.PageContent>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
Expand All @@ -167,6 +169,14 @@ export const Default: Story = {
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.
</p>
<br />
<TextInput
ariaLabel="should scroll under a sticky header"
prefix={<IconSearch />}
suffix={<IconBranch />}
width="large"
/>

<div
style={{
display: 'flex',
Expand All @@ -181,6 +191,7 @@ export const Default: Story = {
))}
</div>
</Layout.PageContent>

<Layout.PageFooter>
<Text isSubtle>2018-2025 SonarSource Sàrl. All rights reserved</Text>
<Links>
Expand Down