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

Beacon positioning on scroll

Open benzen opened this issue 10 years ago • 3 comments

I the target of the beacon in inside a container with scroll (overflow: scroll), the beacon should be repositioned after each scroll.

In the same fashion as with window resize, the events would be debounceable.

benzen avatar Jul 08 '16 01:07 benzen

This will not work currently since the Joyride component is bound to the body.

gilbarbara avatar Jul 09 '16 05:07 gilbarbara

Great work on this project @gilbarbara

I'd really like to use react-joyride in an app where most of the content is in a scrollable div.

What happens now is that if the target element is off screen (e.g. because the containing div has scrolled past it), the beacon will render just near the top of the screen, detached from the target.

I dabbled a little and found that the x/y coordinates are clipped here: https://github.com/gilbarbara/react-joyride/blob/master/src/scripts/Joyride.jsx#L1093

If I disable preventWindowOverflow on that line, the beacon is positioned correctly, but scrolling to the next step doesn't work.

I'm not sure if there is a fundamental incompatibility with scrollable divs, but if you have any suggestions for what would be required to fix it I would be happy to work on it!

Khodeir avatar Feb 27 '17 21:02 Khodeir

Hi @Khodeir, scroll-containers are a big unsolved problem so far. There has been an attempt to add support, but unfortunately we couldn't merge it as it was. You can check that thread for some ideas and issues though, if you're considering cracking this nut. :)

IanVS avatar Feb 27 '17 22:02 IanVS