Mobile emulator fails to mock max-device-width media queries
Reported by
volodym...@wix.com,
Apr 13 2018
|
||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
Steps to reproduce the problem:
1. Open dev tools, turn on mobile simulation
2. Select iPhone 6/7/8 simulation
3. execute `window.matchMedia('(max-device-width: 450px)').matches` in console
What is the expected behavior?
media query should match
What went wrong?
media query does not match
Did this work before? N/A
Chrome version: 67.0.3395.0 Channel: stable
OS Version: OS X 10.13.3
Flash Version:
Looks like media query is matched against the real machine so
`window.matchMedia('(max-device-width: 1681px)').matches === true` for me.
Instead it should match against simulated device width, which is 375
Looks like it was broken somewhere between 65.0.3325.181 and 66.0.3359.81
,
Apr 16 2018
@Reporter: Please check the video and let us know if this is the behavior you are observing? On using window.matchMedia('(max-device-width: 1681px)').matches or window.matchMedia('(max-device-width: 450px)').matches observing result as true but when selecting iPhone 6/7/8 simulation -- max width is 425.
,
Apr 16 2018
,
May 7 2018
Hmm... This works for me. Could you please try again on your end and report back?
,
May 31 2018
Hi, It disappeared after reboot and no longer reproducible for me after that. |
||||
►
Sign in to add a comment |
||||
Comment 1 by susan.boorgula@chromium.org
, Apr 15 2018