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 Position Fix Issue😢 #20

Open
Legitgoons opened this issue May 29, 2024 · 3 comments
Open

Scroll Position Fix Issue😢 #20

Legitgoons opened this issue May 29, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@Legitgoons
Copy link
Collaborator

Describe the bug

There is an issue when navigating pages within the React App. In the iPhone Layout, the method to adjust the scroll position does not work properly and always behaves according to the existing scroll position.

I have tried both window.scrollTo(0, 0) and React Router's scrollRestoration methods.

library version

1.1.1

Operating System Version

window 11

Browser

Chrome

@BangDori BangDori assigned BangDori and unassigned BangDori May 29, 2024
@BangDori
Copy link
Collaborator

BangDori commented Jun 2, 2024

@Legitgoons

Thank you for your interest in our library!

This issue seems to be caused by the iPhone layout not remembering the scroll position. I think I can solve the problem by storing the path and scroll information in sessionStorage. What do you think?

@BangDori BangDori self-assigned this Jun 2, 2024
@BangDori BangDori added the bug Something isn't working label Jun 2, 2024
@BangDori BangDori assigned BangDori and unassigned BangDori Jun 2, 2024
@Legitgoons
Copy link
Collaborator Author

@BangDori
Storing the path and scroll information in sessionStorage is a good idea.
However, if we can figure out why the scroll position is not being remembered in the first place, we might be able to come up with a better solution. I'm curious to know what you think is causing this issue.

@BangDori
Copy link
Collaborator

BangDori commented Jun 4, 2024

My guess is that the browser remembers the scroll position relative to the viewport, so it doesn't remember the scroll position inside the iPhone layout.

Can you set the viewport based on the iPhone layout?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants