react-waypoint icon indicating copy to clipboard operation
react-waypoint copied to clipboard

Horizontally scrolled ancestor picked up as `scrollableAncestor`

Open trotzig opened this issue 9 years ago • 2 comments

I have a structure similar to this:

<body>
  <div style="overflow-x: auto; width: 300px">
     <Waypoint onEnter={doSomething}/>
  </div>
</body>

I was expecting the scrollableAncestor to be resolved to window here, but it ends up being the parent div.

trotzig avatar Sep 17 '16 21:09 trotzig

I think this happens because an element with overflow-x: auto will force some browsers to also set overflow-y: auto.

This provides more insight: https://stackoverflow.com/questions/18135204/setting-overflow-y-causes-overflow-x-to-change-as-well

Not sure if there's anything react-waypoint can do to work around this.

danoc avatar Feb 15 '19 21:02 danoc

Related to #251.

danoc avatar Jun 05 '19 22:06 danoc