Skip to content

How to solve the problem of window flickering when scrolling #617

Answered by KingSora
A-kirami asked this question in Q&A
Discussion options

You must be logged in to vote

@A-kirami You are scrolling as soon as OverlayScrollbars initializes. At the same time you are using the defer: true option which defers the initialization to a point in time where the browser is idle. The flickering you're seeing is the time between the VirtualList and OverlayScrollbars initialization.

You can solve this in two ways:

  1. Don't use defer: true and keep your code like you have it now: https://codesandbox.io/p/devbox/eager-joji-g7w8zn?workspaceId=b640333a-16e9-425d-8bf5-8042416c19c4
  2. Keep defer: true and scroll as soon as the VirtualList initializes and when OverlayScrollbars initializes: https://codesandbox.io/p/devbox/tender-lewin-mlw7yv

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@A-kirami
Comment options

Answer selected by A-kirami
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants