Skip to content

(components) fix: incorrect InView delay calculation#452

Merged
andrewrubin merged 1 commit into
mainfrom
bugfix/in-view-delay-calculation
May 6, 2025
Merged

(components) fix: incorrect InView delay calculation#452
andrewrubin merged 1 commit into
mainfrom
bugfix/in-view-delay-calculation

Conversation

@andrewrubin

@andrewrubin andrewrubin commented May 6, 2025

Copy link
Copy Markdown
Member

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

@changeset-bot

changeset-bot Bot commented May 6, 2025

Copy link
Copy Markdown

🦋 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
Copy Markdown
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.

@marlonmarcello marlonmarcello left a comment

Copy link
Copy Markdown
Member

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