fix: improve useInViewObserver hook to trigger when observer is in view on mount#18446
Merged
emrysal merged 1 commit intocalcom:mainfrom Jan 2, 2025
cnhhoang850:fix/use-in-view-observer
Merged
fix: improve useInViewObserver hook to trigger when observer is in view on mount#18446emrysal merged 1 commit intocalcom:mainfrom cnhhoang850:fix/use-in-view-observer
emrysal merged 1 commit intocalcom:mainfrom
cnhhoang850:fix/use-in-view-observer
Conversation
…dy in view on mount
|
@cnhhoang850 is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (01/02/25)1 reviewer was added to this PR based on Keith Williams's automation. "Add community label" took an action on this PR • (01/02/25)1 label was added to this PR based on Keith Williams's automation. "Add ready-for-e2e label" took an action on this PR • (01/02/25)1 label was added to this PR based on Keith Williams's automation. |
Contributor
E2E results are ready! |
MuhammadAimanSulaiman
pushed a commit
to hit-pay/cal.com
that referenced
this pull request
Jan 10, 2025
…dy in view on mount (calcom#18446)
MuhammadAimanSulaiman
pushed a commit
to hit-pay/cal.com
that referenced
this pull request
Feb 20, 2025
…dy in view on mount (calcom#18446)
This file contains hidden or 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
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.
What does this PR do?
This pull request makes inViewObserver trigger when ref element already intersect view port on mount.
Currently, inViewObserver triggers only when ref element "enters" view port after component mount. This makes infinite scroll loading behavior doesn't work on first page load if view port contains inViewObserver ref element
This PR makes inViewObserver always trigger when ref element is in view, even on first mount, making its behavior more consistent.
As a consequence, any infinite scrolling list that use inViewObserver will continue to load element on first mount up until the point ref element doesn't intersect the view port any more.
Before
Personal.Event.Types.Cal.com.-.2.January.2025.mp4
After
https___www.loom.com_share_60b418ebda554e90a711a6ed0be295f4.-.New.mp4
Loom Video: https://www.loom.com/share/60b418ebda554e90a711a6ed0be295f4?sid=4e41bb73-9501-4f0f-8df2-e0d2953c64c4
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?