mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-18 05:02:24 +08:00
Merge pull request #3639 from storybooks/knob-no-scroll
Don't scroll story on knob change
This commit is contained in:
commit
79375c249a
@ -17,11 +17,7 @@ setOptions({
|
||||
hierarchyRootSeparator: /\|/,
|
||||
});
|
||||
|
||||
addDecorator(Story => (
|
||||
<ThemeProvider theme={themes.normal}>
|
||||
<Story />
|
||||
</ThemeProvider>
|
||||
));
|
||||
addDecorator(story => <ThemeProvider theme={themes.normal}>{story()}</ThemeProvider>);
|
||||
|
||||
configureViewport({
|
||||
viewports: {
|
||||
|
@ -139,8 +139,10 @@ export default function start(render, { decorateStory } = {}) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Scroll to top of the page when changing story
|
||||
document.documentElement.scrollTop = 0;
|
||||
if (!forceRender) {
|
||||
// Scroll to top of the page when changing story
|
||||
document.documentElement.scrollTop = 0;
|
||||
}
|
||||
previousRevision = revision;
|
||||
previousKind = selectedKind;
|
||||
previousStory = selectedStory;
|
||||
|
Loading…
x
Reference in New Issue
Block a user