erikringsmuth / app-router

Router for Web Components
https://erikringsmuth.github.io/app-router/
MIT License
610 stars 83 forks source link

Blank page (mostly) on hash route reloads with iOS/OSX Safari #106

Open nomego opened 9 years ago

nomego commented 9 years ago

If I navigate with Safari to https://erikringsmuth.github.io/app-router, it (usually?) works as it should (even though the page is blank for a long time).

Navigating to a sub page like https://erikringsmuth.github.io/app-router/#/api also works, until I reload that page. Usually, I end up with a blank page, but in some occasions I get the intended page rendering. This hints about some kind of race condition somewhere.

This is on everything from iPhone 4/iPad mini to a MacBook running Safari 8.0.3 on Mac OS X Yosemite.

In our app, I can detect that reloading a page with a hash route never fires the state-change event, but we're doing some other things in and around app-router, so I'm not sure that's the whole truth.

Let me know if you want me to do any other tests to pin this bug down.

nomego commented 9 years ago

In our app, we init appRouter manually and moving the init from the ready() polymer event handler to readyDom() in our wrapping application element seems to init appRouter late enough that our application element had time to register the event listener for state-change. Maybe something similar happens on automatic init (on your site).

erikringsmuth commented 9 years ago

Yeah, I see the problem too. It might be something with the timing in the webcomponentsjs polyfill. I'll have to try to figure out how to debug iOS devices.

erikringsmuth commented 9 years ago

This is weird! I can see all the elements in the dom throughout the screen when I inspect elements but nothing renders. This might be a Safari bug.