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

🐛 [BUG] - AnimationProvider visibilityOptions is ignored when a number #731

Open
jjwinskill opened this issue Sep 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jjwinskill
Copy link

jjwinskill commented Sep 4, 2024

Describe the bug

When using an AnimationProvider component with visibilityOptions set to a number, the number is ignored.

This is because the documentation suggests a number between 0 and 1, and then that number is being divided by 100.

This may be fixable through a documentation update to pick a number between 0 and 100 instead of 0 and 1, though it would also be nice to be able to manually set the root margin too, such as something like

<AnimationProvider visibilityOptions={{threshold: 0.5, rootMargin: '0px 0px -30% 0px'}}>

Reproduction steps

  • In a development environment within Storybook, set a component that has an AnimationProvider to have visibilityOptions of 0.5
  • Observe that component instantly animated when reaching the bottom of the page

Expected behavior

  • Component does not animate until reaching the halfway point of the page (this is my current understanding, but it may be intended that the component is halfway onto the page when it begins animating. Neither scenario appears to be working)

Screenshots

No response

Browsers

Chrome

OS

Mac

@jjwinskill jjwinskill added the bug Something isn't working label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant