brand
brand copied to clipboard
🐛 [BUG] - AnimationProvider visibilityOptions is ignored when a number
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
AnimationProviderto havevisibilityOptionsof0.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