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

🐛 Fix initial scroll to top before scrolling to target #801

Merged
merged 4 commits into from
Feb 20, 2020

Conversation

chuckcarpenter
Copy link
Member

This fixes the issue with the document scrolling to top before each step is shown. Also, removes extra renders via the forced update in _step() method.

this.el.hidden = false;

this.tooltip.update();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure we can remove this? Perhaps this was the wrong approach, but I think we needed to call update to ensure things got repositioned when scrolling or resizing the page etc.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems to do extra renders, does the eventlistener for scroll call the initial show function?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure, but we need an update somewhere I think. Maybe I am wrong and popper now handles this internally?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it update on scroll and resize without this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when it is out of viewport, there's a data attr added and we use that to set opacity to 0. What behavior where you expecting. Also, resize seems to have it's own internal events, as it does work as I'd expect.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just ensuring that the popper moves around and tries to stay in the viewport. I think on resize and scroll, the popper would stay in one spot before, if we weren't calling update.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked this out locally, and it seems to be fine 👍

@@ -29,7 +29,7 @@ describe('General Utils', function() {
}
});

const { popperOptions } = getPopperOptions(parseAttachTo(step), step);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scope the test to just one method

@RobbieTheWagner RobbieTheWagner merged commit ae8f987 into master Feb 20, 2020
@RobbieTheWagner RobbieTheWagner deleted the bug/scroll-up-on-step branch February 20, 2020 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants