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

Question/Issue about the overflow management #7

Open
keul opened this issue May 31, 2018 · 1 comment
Open

Question/Issue about the overflow management #7

keul opened this issue May 31, 2018 · 1 comment

Comments

@keul
Copy link

keul commented May 31, 2018

Not sure if this is an issue or simply a request for clarify me how the code is working, is not easy to me to understand the logic behind the library (hint: maybe some comments could help! 😄 )

I've an issue in another project that use scrollparent.js as a dependency (see gilbarbara/react-joyride#376).

After lot of debugging the issue seems related to the management of CSS overflow that is done here:

return style(node, "overflow") + style(node, "overflow-y") + style(node, "overflow-x");

I'm trying to understand how this should work, why overflow is special for you, as every DOM element that use overflow are giving me issues.

Any tips will be appreciated!

@danoc
Copy link

danoc commented Jun 5, 2019

I'm not the author, but the function checks to see if getComputedStyle(myDomNode).overflow, getComputedStyle(myDomNode).overflowX, or getComputedStyle(myDomNode).overflowY contain either auto or scroll. If it does, then it means that the parent is scrollable.

Elements default to overflow-x: visible and overflow-y: visible. What is less know is that adding overflow-x: hidden will cause overflow-y' to become autoand AFAIK there's no way to then changeoverflow-yto hidden as well. This library then seesoverflow-y: auto` and thinks that you meant for the container to be scrollable.

More on this here:
civiccc/react-waypoint#118
https://stackoverflow.com/questions/18135204/setting-overflow-y-causes-overflow-x-to-change-as-well

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

2 participants