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 history.listen triggered by initial page load on some old browsers #555

Merged
merged 2 commits into from Sep 11, 2019
Merged

Fix history.listen triggered by initial page load on some old browsers #555

merged 2 commits into from Sep 11, 2019

Conversation

yangmingshan
Copy link

@yangmingshan yangmingshan commented Dec 28, 2017

Popstate event will fire after initial page load on some old browsers, like Safari on iOS 9. It will trigger history.listen.

This PR is a hack to fix this problem, the solution is from page.js. I tested on iOS 9, it worked.

@yangmingshan
Copy link
Author

I don't know why the Travis CI always timeout 😔

@mjackson
Copy link
Member

Thanks for the PR, @yangmingshan. Is this code lifted directly from page.js? If so, I'd like to include a comment that tells people where we got it so we give attribution where it's due.

Would you mind rebasing on top of the current master?

@yangmingshan
Copy link
Author

Rebased. And yes, this code is from page.js, you can find in here.

How I get the testing pass, is there something wrong?

@yangmingshan
Copy link
Author

The solution source information added.

@dc-me
Copy link

dc-me commented Jun 6, 2019

What's the status here? today I run into the same problem.

@yangmingshan
Copy link
Author

@mjackson Can you look at it? It's been a long time.

@mjackson mjackson merged commit 3567ed3 into remix-run:master Sep 11, 2019
@mjackson
Copy link
Member

Sorry for the delay here. This will be released in 4.10.

@mjackson
Copy link
Member

Hi @yangmingshan, I merged this but it causes one of our tests to fail on Firefox. You can see the failure here: https://travis-ci.org/ReactTraining/history/jobs/583498880

I'm going to revert the commit for now, but I'd be open to trying again if you can figure out what's going wrong in Firefox. Thanks!

@lock lock bot locked as resolved and limited conversation to collaborators Nov 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants