Skip to content

(components) fix: incorrect InView delay calculation #452

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

Merged
merged 1 commit into from
May 6, 2025

Conversation

andrewrubin
Copy link
Member

@andrewrubin andrewrubin commented May 6, 2025

Time tracking: https://wethecollective.teamwork.com/app/tasks/22769488

Description

Fixes an issue on the get-duration Sass function, where the delay was being calculated incorrectly. For example, passing delay={8} should get you a delay of 0.8s, but it was returning 0.4s.

Solution

  • Removed the second argument ($subdivisions) from this helper entirely, as it doesn't seem helpful. We never run into cases where we need to divide our inputs by any other increments than 10. It also just confuses the usage a bit.

Additional Notes

Copy link

changeset-bot bot commented May 6, 2025

🦋 Changeset detected

Latest commit: 6b91cd9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@wethegit/components Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment on lines +58 to 63
--duration: #{get-duration($i)};
}

.staggerDuration#{$i} {
--stagger-duration: #{get-duration($i, 20)};
--stagger-duration: #{get-duration($i)};
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two lines were the culprit (passing 20 for the second arg). I ended up removing the second arg entirely though.

Copy link
Member

@marlonmarcello marlonmarcello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes total sense

@andrewrubin andrewrubin force-pushed the bugfix/in-view-delay-calculation branch from 06891e5 to 6b91cd9 Compare May 6, 2025 16:27
@andrewrubin andrewrubin merged commit 701c246 into main May 6, 2025
4 checks passed
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

Successfully merging this pull request may close these issues.

[COMP]: InViewItem duration calculations are incorrect
2 participants