mobile-angular-ui icon indicating copy to clipboard operation
mobile-angular-ui copied to clipboard

Online demo works badly with Chrome on iPhone

Open samedii opened this issue 9 years ago • 6 comments

Multiple problems on iOS 9.0.2 and Chrome v 45.0.2452.89:

  • Menu is reopened after a menu item is clicked
  • Navigation doesn't work
  • Scrolling doesn't work

I'm sure there's a lot more. However, it works fine on safari.

samedii avatar Oct 08 '15 15:10 samedii

Same problem occurs in Safari but this needs an additional easy step to reproduce. You need to add the website to your home screen (like bookmark but on home screen). After that, the menu is not usable anymore with exactly the same problem as depicted in this ticket.

xperseguers avatar Oct 11 '15 05:10 xperseguers

Same here. Website opened from home screen in safari shows exactly same behaviour like in chrome on iPhone. Too bad.

HerrHansen avatar Oct 22 '15 00:10 HerrHansen

@HerrHansen @xperseguers The issue is with Safari and not with MobileAngularUI. See section 10.3 of this spec https://w3c-webmob.github.io/installable-webapps/ You need to override the default a href behavior with document.addEventListener("click", function (e) { var elem = e.target; if (elem.tagName && elem.tagName === "A") { e.preventDefault(); location.href = elem.href; } });

ElleryW avatar Oct 26 '15 15:10 ElleryW

Ah I see. Sorry, my fault. I forgot to add this proper code to YOUR online demo. ;-P Thank you.

HerrHansen avatar Oct 26 '15 16:10 HerrHansen

@HerrHansen I am in no way affiliated with Mobile Angular UI, but I'll make a PR for this. If you actually make web apps and want to add this to your app then you should only register this event handler when the app starts if it meets the following conditions: if (((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) && window.navigator.standalone)

This will make sure the user is actually on an apple device and they have launched from the home screen.

ElleryW avatar Oct 26 '15 16:10 ElleryW

You are welcome,my friend.

At 2015-10-27 00:38:22, "HerrHansen" [email protected] wrote:

Ah I see. Sorry, my fault. I forgot to add this proper code to YOUR online demo. ;-P Thank you.

— Reply to this email directly or view it on GitHub.

Jason7Le avatar Oct 27 '15 08:10 Jason7Le