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

overflow: auto displays scrollbars during animation #16

Open
ty-bt opened this issue May 27, 2022 · 4 comments
Open

overflow: auto displays scrollbars during animation #16

ty-bt opened this issue May 27, 2022 · 4 comments

Comments

@ty-bt
Copy link

ty-bt commented May 27, 2022

windows chrome 102.0.5005.63

https://codesandbox.io/s/naughty-butterfly-ze3mcu?file=/src/App.js

When overflow is auto, the scroll bar will flicker during animation
Subsequent animation flickers after scrolling scrollbar manually
333

@justin-schroeder
Copy link
Member

Not sure there is a good solution to this other than setting your styles appropriately. I dont think we can make any reliable determination of what the users desired styles are here. For example, we could put overflow: none durring the animation, but that would make the parent's scrollbars pop on/off during animation when there should be a scroll bar. Open to suggestions though.

@justin-schroeder justin-schroeder changed the title css overflow auto animation exception overflow: auto displays scrollbars during animation May 27, 2022
@ty-bt
Copy link
Author

ty-bt commented May 30, 2022

@justin-schroeder And the first animation after moving the scroll bar will be abnormal

@Daneng66
Copy link

@ty-bt Did you figure out a solution for this?

@glekner
Copy link

glekner commented Sep 24, 2024

Not sure there is a good solution to this other than setting your styles appropriately. I dont think we can make any reliable determination of what the users desired styles are here. For example, we could put overflow: none durring the animation, but that would make the parent's scrollbars pop on/off during animation when there should be a scroll bar. Open to suggestions though.

@justin-schroeder why not do the following:

  1. before starting the animation, we determine if the container has overflowing content or not for each axis (e.g. is p.scrollHeight > p.offsetHeight)
  2. only if there is no overflowing content, we can safely add overflow: hidden until the animation finishes.

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

No branches or pull requests

4 participants