Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a storybook util to detect when a story is scrolled into view #104

Open
mkrause opened this issue Jan 15, 2025 · 0 comments
Open

Comments

@mkrause
Copy link
Collaborator

mkrause commented Jan 15, 2025

We have a lot of stories where things happen automatically. For example, overlays like modals, dialogs, toast notifications, etc. This automatic triggering is needed because the UI must be visible without user interaction, for things like visual testing.

However for auto-generated docs pages (including all of the pages on the github.io storybook), this results in a bunch of things happening all at once, because all the stories are loaded on the page even if the user isn't actually viewing it.

We should investigate building a utility to only render a story if the user has scrolled to it. Something like the hidden="until-found" browser feature (but we can't use that yet due to browser support and this React issue).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant