-
Notifications
You must be signed in to change notification settings - Fork 3
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
[Bugfix] withScrolledInView
not rendered when mounting and in view
#584
Merged
titouanmathis
merged 4 commits into
develop
from
bugfix/with-scrolled-in-view-mount-no-render
Jan 24, 2025
Merged
[Bugfix] withScrolledInView
not rendered when mounting and in view
#584
titouanmathis
merged 4 commits into
develop
from
bugfix/with-scrolled-in-view-mount-no-render
Jan 24, 2025
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
An initial render should occur on mount as the resized or scrolled event might not have been fired yet, preventing any updates, even for elements that are already in view.
Export Size@studiometa/js-toolkit
Unchanged@studiometa/js-toolkit
|
Codecov ReportAll modified and coverable lines are covered by tests β
Additional details and impacted files@@ Coverage Diff @@
## develop #584 +/- ##
===========================================
+ Coverage 98.97% 99.01% +0.04%
===========================================
Files 122 122
Lines 4180 4183 +3
Branches 1138 1139 +1
===========================================
+ Hits 4137 4142 +5
+ Misses 43 41 -2
Flags with carried forward coverage won't be shown. Click here to find out more. β View full report in Codecov by Sentry. |
titouanmathis
deleted the
bugfix/with-scrolled-in-view-mount-no-render
branch
January 24, 2025 09:40
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
π Linked issue
No issue.
β Type of change
π Description
The
withScrolledInView
decorator adds support for ascrolledInView(props)
method on a component, allowing custom behaviors to be triggered only when its root element is in view.Previously, the
scrolledInView(props)
method was called only on resize or scroll events, preventing execution of these custom behaviors if the user had not scrolled or resized its browser window.This PR fixes this by triggering the method once when the component is mounted.
π Checklist