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

Mobile type determining by screen width works incorrectly #22

Closed
denich opened this issue Mar 9, 2015 · 0 comments · Fixed by #23
Closed

Mobile type determining by screen width works incorrectly #22

denich opened this issue Mar 9, 2015 · 0 comments · Fixed by #23

Comments

@denich
Copy link
Contributor

denich commented Mar 9, 2015

I found an issue regarding to determining device based on screen width.
We divide screen width on device pixel ratio.

var physicalPixelWidth = window.screen.width,
  pixelRatio = window.devicePixelRatio || 1,
  cssPixelWidth = physicalPixelWidth / pixelRatio;

It's mistakenly because window.screen.width already has density independent pixels value (tested on several real devices).

So I suggest to eliminate this division.

Actually it'll be good to use smallest-width qualifier approach instead - the same as android use to determine small/large screen devices.

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

Successfully merging a pull request may close this issue.

1 participant