-
Notifications
You must be signed in to change notification settings - Fork 319
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
Infinite Loop Between Scroll and Redraw on Browser Zoom #238
Comments
arthur-cheung
pushed a commit
to arthur-cheung/vis-timeline
that referenced
this issue
Jan 3, 2020
arthur-cheung
added a commit
to arthur-cheung/vis-timeline
that referenced
this issue
Jan 6, 2020
yotamberk
added a commit
to arthur-cheung/vis-timeline
that referenced
this issue
Jan 18, 2020
Very interesting. Not sure why this happens, especially only in Chrome. |
yotamberk
added a commit
that referenced
this issue
Jan 18, 2020
…redraw (#238) (#240) * Added flag to programatic scrolling to avoid infinite scroll during redraw. (#238) * Update Core.js Co-authored-by: Yotam Berkowitz <[email protected]>
🎉 This issue has been resolved in version 6.4.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sennahoi
added a commit
to Sennahoi/vis-timeline
that referenced
this issue
Jan 13, 2021
yotamberk
added a commit
that referenced
this issue
Jan 15, 2021
* Update Core.js Fixed flickering when scrolling at the end of the timeline, fixes #422 * Alternative fix for #238 Co-authored-by: Yotam Berkowitz <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When adjusting browser zoom, it appears
_redraw
is triggered which calls_updateScrollTop
inCore.js
. This in turn triggers event listeners on scroll which callonMouseScrollSide
, which in turn calls_redraw
again, causing an infinite loop of scroll.The symptoms are the timeline will slowly scroll to the top. When it reaches the top it then "jitters".
From what I can follow in the code, I would have expected this to happen all the time. But I can only reproduce it under certain browser zooms. In the case of the example I created in codesandbox, I can only produce it at 75% zoom. So I'm obviously missing some understanding here of how the code works.
Nevertheless, I think this can be fixed easily if a flag is just set to true when
_updateScrollTop
is called. Then inonMouseScrollSide
, if this flag is true, set it to false and abort. I am happy to take this change on if this is deemed okay.I would also like to fill in my gaps in understanding why this only occurs on certain zooms, if anyone knows.
Example created in codesandbox here.
EDIT - Additional notes:
maxHeight
is set in the options to the timeline.The text was updated successfully, but these errors were encountered: