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

Incorrect regex for iOS version #72

Open
matthewenks opened this issue Nov 6, 2016 · 3 comments
Open

Incorrect regex for iOS version #72

matthewenks opened this issue Nov 6, 2016 · 3 comments

Comments

@matthewenks
Copy link

viewport-units-buggyfill.js

Line 45 was: var iOSversion = userAgent.match(/OS (\d)/);

Guessing it should be: var iOSversion = userAgent.match(/OS (\d+)/);

As an aside, should like 48 read like this?

return iOSversion && iOSversion.length>1 && parseInt(iOSversion[1], 10) < 8;

@rodneyrehm
Copy link
Owner

Guessing it should be: var iOSversion = userAgent.match(/OS (\d+)/);

makes sense. do you want to send a PR for this?

As an aside, should like 48 read like this?

that effectively limits the buggyfill to iOS 7. I'm not sure it's still required in iOS 10

@matthewenks
Copy link
Author

I'm not sure either actually - from what I've experienced viewport units work, albeit in an Apple-prescribed way. vh units will always take the maximum height of the viewport (ie. with the address bar hidden), rather than the current available height.

I've not contributed to open source before - I'll have a look into creating a PR shortly :)

@johntron
Copy link

FYI - the iOS version matching was fixed in #85.

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

No branches or pull requests

3 participants