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 chromeIOS and edgeIOS browser back button problems #1999

Open
wants to merge 2 commits into
base: v1
Choose a base branch
from

Conversation

AbdullahAgsar
Copy link

No description provided.

@RobertBoes
Copy link
Contributor

Seems like this might require more than just a list of browsers. All third party browsers on iOS are essentially glorified Safari webviews. So this issue would likely exist in every single browser on iOS apart from Safari itself. Perhaps it would be a good idea to change the check to "is ios and not safari"

@AbdullahAgsar
Copy link
Author

@RobertBoes This issue was also present in Safari itself in the past few weeks, but it was resolved within just a few days. I’m not entirely sure, but I think it received an update. I believe the issue will be completely resolved once the browsers receive a new version.

@reinink reinink changed the base branch from master to v1 October 9, 2024 15:23
Comment on lines -509 to -515
if (isChromeIOS) {
// Defer history.replaceState to the next event loop tick to prevent timing conflicts.
// Ensure any previous history.pushState completes before replaceState is executed.
setTimeout(() => window.history.replaceState(cloneSerializable(page), '', page.url))
} else {
window.history.replaceState(cloneSerializable(page), '', page.url)
}
Copy link
Member

Choose a reason for hiding this comment

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

Curious, why did you delete this block of code? Wouldn't it just need to be updated to isChromeIOS || isEdgeIOS as well?

Copy link
Author

Choose a reason for hiding this comment

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

During my testing, I observed that when navigating from one page to another, the replaceState function is called first, followed by pushState, and then replaceState is triggered again. For example, when transitioning from the home page to the dashboard, the browser would first process the home page with replaceState, then execute pushState for the dashboard page, and afterward call replaceState again. With this sequence, the back navigation worked, but I had to click the back button twice to return to the previous page. After adjusting the replaceState function, the issue of adding the same page twice was resolved, and now a single back button click is enough to return to the previous page.

@Kokkey
Copy link

Kokkey commented Nov 4, 2024

any updates on this ?
I'm having the same issues

@AbdullahAgsar
Copy link
Author

any updates on this ? I'm having the same issues

i don't have any solution for this issues

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

Successfully merging this pull request may close these issues.

4 participants