Skip to content
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: horizontal scrolling can cause screen flickering #722

Merged
merged 1 commit into from
Feb 3, 2023

Conversation

ghiscoding
Copy link
Collaborator

@ghiscoding ghiscoding commented Feb 2, 2023

  • add a delay of a cycle to avoid screen flickering that we observed to be worst in Chrome and Salesforce. This small delay of 1 cycle is enough to remove the flickering
  • the process is that when the grid is being scrolled horizontally, it has to change the scroll position of every other div container that might exist (preheader, headerrow, footer) and if we change the position at the same time as the grid scroll it can cause flickering
  • this flickering only happens in Chromium based browser (Firefox doesn't have this problem) and I'm pretty sure that last year we didn't have this problem so it might be a new Chrome bug (or Salesforce I don't know) but regardless of when, this PR should help in any case
  • this PR should also help with this Stack Overflow question

The animated gif is not actually fast enough to catch the entire flickering, it's a lot worst for the user but it happens in millisecond and hard to catch by the recorder by annoying enough for human eyes. even if the gif is not showing the real flickering, it's enough to demonstrate the flickering we observed

msedge_Uqid8Oe7TS

- add a delay of a cycle to avoid screen flickering that we observed to be worst in Chrome and Salesforce. This small delay of 1 cycle is enough to remove the flickering
- the process is that when the grid is being scrolled horizontally, it has to change the scroll position of every other div container that might exist (preheader, headerrow, footer) and if we change the position at the same time as the grid scroll it can cause flickering
@ghiscoding ghiscoding requested a review from 6pac February 2, 2023 16:56
@6pac
Copy link
Owner

6pac commented Feb 3, 2023

My only question here is are you trying to do rate limiting (ie. limiting the number of h scroll events that occur in a time period)? Otherwise, I'm not sure why the delay makes a difference.

@6pac
Copy link
Owner

6pac commented Feb 3, 2023

OK, sorry, looked a bit closer and I understand now. Good fix.

@6pac 6pac merged commit 0d4d943 into master Feb 3, 2023
@ghiscoding
Copy link
Collaborator Author

@6pac
a simple delay to avoid racing conditions and flickering, I think it's a very common problem in UI.
Could you also merge the other PR #716, I also got another one coming after that

@6pac
Copy link
Owner

6pac commented Feb 3, 2023 via email

@ghiscoding ghiscoding deleted the bugfix/horizontal-scroll-screen-flickering branch February 10, 2023 04:40
ghiscoding added a commit that referenced this pull request Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants