-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix: scrolling can be incorrect when fast-forwarding #1352
fix: scrolling can be incorrect when fast-forwarding #1352
Conversation
🦋 Changeset detectedLatest commit: 7a7a0d6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
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 |
Thank you! Do you think it would be possible to extract a minimal test case from the rrdebug data? We have |
540ca8b
to
18ae4c2
Compare
thanks for taking a look! just added a test case and confirmed it passes w/ my changes (and fails without them) 👍 |
18ae4c2
to
c1a7581
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@juliecheng Thanks for finding out this bug. This is amazing!
I made one minor change on this pull request, can you please review it?
pendo-io#9
…-children add changeset and remove duplicate diffProps process
@YunFeng0817 ready for re-review when you get a chance please 🙏 |
* fix: scrolling can be incorrect when fast-forwarding * add test case * add changeset and remove duplicate diffProps process --------- Co-authored-by: Yun Feng <yun.feng0817@gmail.com>
* fix: scrolling can be incorrect when fast-forwarding * add test case * add changeset and remove duplicate diffProps process --------- Co-authored-by: Yun Feng <yun.feng0817@gmail.com>
👋 hello! i'm seeing an issue where the scrolling position of the dom can end up being incorrect after skipping when using the virtual dom. here is an example replay to visualize the issue:
https://rrwebdebug.com/play/index.html?url=https%3A%2F%2Fgist.githubusercontent.com%2Fjuliecheng%2F6f264bae8fa3bcfc56b3011d4bf3b737%2Fraw%2F84f6ddc329abb88b6b8d26a76306b4f10a33028a%2Fbroken-scrolling.json&version=2.0.0-alpha.8&virtual-dom=on&play=on
if you let it play regularly, you'll see that about 2 seconds in I scroll down so the number 7 + "click" button is now visible for the remainder of the replay. if you skip all the way back to the beginning of the replay + pause immediately (so that you still see "Test Page"), then skip to some spot in the middle of the replay, the scrolling position is incorrect (it didn't scroll) compared to the regular playback.
if the node we're trying to call
applyScroll
on has its height affected by the styles of its parent node, and the parent node is missing attributes that prevent the CSS selector rules from matching at the timeapplyScroll
is called, we run into an issue w/ scrolling. the node'sclientHeight
can equalscrollHeight
w/o the parent styles which meansscrollTo
won't actually do anything. here is an example css:not sure if there is a more elegant solution in mind for this but my thought process was to run
diffProps
insidediffBeforeUpdatingChildren
so that newly created nodes that are missing attributes will now have them added (and therefore styles applied). then whendiffChildren
runs andapplyScroll
is called on one of its child nodes all of the styling and height calculations should be correct