sorich87 / bootstrap-tour

Quick and easy product tours with Twitter Bootstrap Popovers
http://bootstraptour.com
MIT License
4.44k stars 941 forks source link

Defining step placement as function breaks scrollIntoView #678

Closed skybondsor closed 6 years ago

skybondsor commented 6 years ago

The documentation says step placement accepts either a string or a function, but defining it as a function breaks scrollIntoView for that step – the page scrolls to the top before then scrolling to the step's element.

To fix, I added a variable placement just before the switch statement on line 638 in bootstrap-tour.js and then had the switch statement reference that variable instead of step.placement:

... scrollTop = 0; var placement = typeof step.placement === "function" ? step.placement() : step.placement; switch (placement) { ...

skybondsor commented 6 years ago

This was apparently only an issue in the minified version of 0.10.3, so nevermind!