Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 784afa8

Browse files
reset scroll story decorator
1 parent 4766db5 commit 784afa8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎.storybook/config.js‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,15 @@ const CenterDecorator = storyFn => (
1212
</div>
1313
);
1414

15-
addDecorator(CenterDecorator);
15+
// reset the window on each story
16+
const withWindowReset = storyFn => {
17+
window.scrollTo(0, 0);
18+
return storyFn();
19+
};
20+
1621
addDecorator(withKnobs);
22+
addDecorator(withWindowReset);
23+
addDecorator(CenterDecorator);
1724

1825
const req = require.context('../stories', true, /\.stories\.js$/);
1926

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /