storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
84.07k stars 9.24k forks source link

Provide a way to conditionally stop scrollIntoView from storybook docs #19252

Open shriharij opened 2 years ago

shriharij commented 2 years ago

Problem Statement: I am including the storybook docs URL as source of iframe in an another web application that displays all the stories and other additional info. However, the page gets auto scrolled to the first story in the docs page. Which is a problem as there are other information on top of that iframe which user requires to go through first. Looking at the code, apparently DocsContainer.tsx calls the utils.ts method to scrollIntoView and there is no conditional check before calling the utils method. (may be w3c specs?? not sure) Moreover, I do not own the web components for which I am writing the stories to try out any workarounds from web components side.

Describe the solution you'd like Provide a flag and/or method to using which I can deliberately stop the scrollIntoView when I open docs page from another app

Describe alternatives you've considered None. I do not own the web components for which I am writing the stories to try out any workarounds from web components side. I am not aware if storybook already provides a way to stop this. Please advise

Are you able to assist to bring the feature to reality? yes, I can...

jamieomaguire commented 1 month ago

Just wanted to echo what @shriharij has mentioned. We experience this exact same issue on our documentation site.