gilbarbara / react-joyride

Create guided tours in your apps
https://react-joyride.com/
MIT License
6.88k stars 529 forks source link

Page does not scroll if scrollToFirstStep is not specified #524

Closed dropbeardan closed 5 years ago

dropbeardan commented 5 years ago

🐛 Bug Report

Page does not scroll if the Joyride does not have the scrollToFirstStep passed to it despite the target being off-page.

It seems to be in-line with previous findings (https://github.com/gilbarbara/react-joyride/issues/523)

To Reproduce

Comment out the scrollToFirstStep prop from the Basic demo and it will reproduce the issue (see codesanbox link)

Expected behavior

It should scroll to center the target in the middle of the screen if possible.

Link to repl or repo (highly encouraged)

https://mp10h.codesandbox.io/

dropbeardan commented 5 years ago

In IE11, this does not scroll even when scrollToFirstStep is specified

dropbeardan commented 5 years ago

IE11 scroll works with scrollToFirstStep and adding a browser DOM polyfill: https://github.com/mathiasbynens/document.scrollingElement

as per recommendation from scrollparent which React Joyride utilises for scrolling concerns