Skip to content

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

Merged
RobbieTheWagner merged 4 commits intomasterfrom
bug/scroll-up-on-step
Feb 20, 2020
Merged

🐛 Fix initial scroll to top before scrolling to target#801
RobbieTheWagner merged 4 commits intomasterfrom
bug/scroll-up-on-step

Conversation

@chuckcarpenter
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 👍

}
});

const { popperOptions } = getPopperOptions(parseAttachTo(step), step);
Copy link
Copy Markdown
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