Skip to content

Commit

Permalink
Merge pull request #248 from newscorp-ghfb/feat/PPDSC-2218-scroll-com…
Browse files Browse the repository at this point in the history
…ponent-story

feat(PPDSC-2218): added Scroll storybook scenario
  • Loading branch information
agagotowiec authored Jul 6, 2022
2 parents 5d83c58 + c0ee084 commit f5e1f6e
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion src/scroll/__tests__/scroll.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {Block} from '../../block';
import {Image} from '../../image';
import {createTheme, ThemeProvider} from '../../theme';
import {getSSRId} from '../../utils';
import {Button} from '../../button';
import {Button, ButtonSize} from '../../button';

const myCustomTheme = createTheme({
name: 'my-custom-scroll-theme',
Expand Down Expand Up @@ -342,3 +342,26 @@ export const StoryLogicalProps = () => (
</MainContainer>
);
StoryLogicalProps.storyName = 'logical-props';

export const StoryScrollInsideTheContainer = () => (
<MainContainer>
<StorybookSubHeading>
Scroll elements inside the container using tab key
</StorybookSubHeading>
<Container width="250px" height="100px">
<Scroll scrollBar controls="static" tabIndex={-1}>
<Flex>
{Array.from({length: 10}, (_, i) => (
<Button
key={getSSRId()}
tabIndex={0}
size={ButtonSize.Small}
>{`Item ${i + 1}`}</Button>
))}
</Flex>
</Scroll>
</Container>
</MainContainer>
);
StoryScrollInsideTheContainer.storyName =
'scroll-inside-the-container-with-tab-key';

0 comments on commit f5e1f6e

Please sign in to comment.