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

Scroll mainPanel to the top after change page... #10

Closed
kzeman opened this issue May 19, 2018 · 4 comments
Closed

Scroll mainPanel to the top after change page... #10

kzeman opened this issue May 19, 2018 · 4 comments

Comments

@kzeman
Copy link

kzeman commented May 19, 2018

It happens, that if you scroll selected page to the bottom and switch to another page, then the position of the newly selected page remains. It would be better after selecting another page it will show from top position.

@einazare
Copy link
Contributor

Hello @kzeman ,

Yes, it would be best for this behavior to happen.
I've added a note for this issue, on my next update i'm going to make it happen.

Best,
Manu.

@kzeman
Copy link
Author

kzeman commented May 21, 2018

Hello again @kzeman ,

Here is the sample code:

componentDidUpdate(e) {
if (e.history.location.pathname !== e.location.pathname) {
this.refs.mainPanel.scrollTop = 0;
}
}
Best,
Manu

That works!

@kzeman kzeman closed this as completed May 22, 2018
@bertha22
Copy link

when i run, it pops up "e.history" is undefined, how did you solve this problem?

@einazare
Copy link
Contributor

Hello @bertha22 ,

Thank you for your interest in using our product and sorry for this late response (i've been on a small vacation - next week i also be on vacation).
Have you changed something to out product?

Best,
Manu

@einazare einazare reopened this Aug 28, 2018
einazare added a commit to creativetimofficial/now-ui-kit-react that referenced this issue Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants