-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
1. Read the FAQs π
β
2. Describe the bug
Changes to element dimensions won't trigger scroll progress. This is problematic for cases where this is forced (like calculating element's height on the client).
3. IMPORTANT: Provide a CodeSandbox reproduction of the bug
https://stackblitz.com/edit/stackblitz-starters-xvjyb4?file=app%2Fpage.tsx
4. Steps to reproduce
Steps to reproduce the behavior:
Go to the reproduction, refresh the result, and observe the actual behavior:
- Blue box's height is
50dvh, yellow's one is0. The progress goes to1(nothing to even scroll) - After 1.5s, yellow box's height goes to
300dvh. The progress is still1, however, it should be0. - Scroll a bit. You'll see that the progress is recalculated to the correct value and it indeed should have been
0initially.
5. Expected behavior
Changes to element dimensions should also trigger scroll progress recalculation.
Steps to reproduce is descriptive. Here I'll note that the only "hack" I found out for now is to setTimeout with scrollYProgress.set, which I don't like (the timeout is so indefinite and go up to 500ms).
6. Video or screenshots
N/A, see the reproduction
7. Environment details
Framer Motion 11.2.11, other's N/A