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

Scrolling to an element causes modal overlay to appear in wrong place #319

Closed
rswheeldon opened this issue Jan 15, 2019 · 5 comments
Closed
Labels

Comments

@rswheeldon
Copy link

If I set up a tour with the following

    let tour = new Shepherd.Tour({
      useModalOverlay: true,
      defaultStepOptions: {
        scrollTo: true
      }
    })

And have a step in the tour which requires scrolling, then the window scrolls so the element is visible but puts the mask in the place which would have covered the element in its previous position.

@RobbieTheWagner
Copy link
Member

Can you provide a reproduction of this? I've used scrollTo and seen the correct behavior.

@rswheeldon
Copy link
Author

Thanks for the quick response. I've attached a one-page HTML example that demonstrates the problems.
On my setup, the paragraph starting "Sed quis facilisis sapien" is just at the bottom of the screen.

After some more digging, I found the culprit is the scrolling div within the page. If I remove the style elements from the div, everything works fine - i.e. if the page itself scrolls, it works, if some part of the page scrolls it doesn't.

shepherd-scroll-glitch.zip

@RobbieTheWagner
Copy link
Member

@rswheeldon that makes sense, as our scroll listener is on the window, so scrolling other elements probably would not fire it.

@RobbieTheWagner
Copy link
Member

@chuckcarpenter @BrianSipple how should we handle this? We probably do not want to add scroll listeners to every element on the page right?

@chuckcarpenter
Copy link
Member

maybe see what element triggered the listener? Only reacting on window itself?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants