Skip to content

fix #1675 #1677

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

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open

fix #1675 #1677

wants to merge 4 commits into from

Conversation

hxlniada
Copy link

@hxlniada hxlniada commented Aug 11, 2017

fix #1675

I add a shouldUpdateRoute method which is always true except in html5.js when the route isready and the browser don't support history pushstate(such as ie9)

because only history mode have the chance to disable the updateRoute method
which is force ie9 to history mode(fallback: false, for server render)

@callumacrae
Copy link

shuoldUpdateRoute -> shouldUpdateRoute 😀

@hxlniada
Copy link
Author

when will you merge this pr?

@hxlniada
Copy link
Author

@LinusBorg @posva hello, when will this pr be merged?
or is there some reason that this pr won't be merged?

I will use this feature soon.

@posva
Copy link
Member

posva commented Sep 23, 2017

I still have to properly test this. It's a bit weird to never use the fallback option in the check

@hxlniada
Copy link
Author

hxlniada commented Oct 8, 2017

@posva
in src/index.js line 45

this.fallback = mode === 'history' && !supportsPushState && options.fallback !== false
if (this.fallback) {
    mode = 'hash'
}

we know when we are in history mode(src/history/html5.js) and we are in a browser that doesn't support push state, then we know we have set the fallback option to false manully. if not, we will use src/history/hash.js .

so we don't need to check the fallback option, just need to check if we are in history mode and we are in a browser that doesn't support push state.

the logical is: when we are in history mode, and the browser doesn't support push state, and the router has already initialized. we should just jump(window.location[replace ? 'replace' : 'assign'](url)).

thank you.

ps: I have tested this on my ie9 and it works well.

@hxlniada
Copy link
Author

hxlniada commented Oct 16, 2017

@posva @LinusBorg hello, is this ok? should I do something? /(ㄒoㄒ)/~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

when using history mode in IE9 and fallback:false, page will flash before refresh
3 participants