ionic-framework: bug: platform#is('desktop') returning true on new Pixel 7 phones
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
- v4.x
- v5.x
- v6.x
- Nightly
Current Behavior
On new pixel 7 phones, when the devices screen resolution is set to factory defaults (e.g. “highest” / “smallest” or “make everything as small as possible to show as much as possible” … max resolution), Ionic apps are reporting that the platform is ‘desktop’.
If screen resolution is dropped down by one notch, the platform is properly reported as ‘mobile’.
Not sure how best to report this, but this is what we’re seeing.
Expected Behavior
The platform should be reported as ‘mobile’, not ‘desktop’.
Steps to Reproduce
Run any ionic app on a Google Pixel 7 with default factory display settings. Platforms will contain ‘desktop’.
Code Reproduction URL
No response
Ionic Info
mshark:topdecked-unified lincoln$ ionic info
Ionic:
Ionic CLI : 6.20.1 (/Users/lincoln/.nvm/versions/node/v16.14.0/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 6.3.4
@angular-devkit/build-angular : 14.2.8
@angular-devkit/schematics : 14.2.8
@angular/cli : 14.2.8
@ionic/angular-toolkit : 7.0.0
Capacitor:
Capacitor CLI : 4.4.0
@capacitor/android : 4.4.0
@capacitor/core : 4.4.0
@capacitor/ios : 4.4.0
Utility:
cordova-res : not installed globally
native-run : 1.7.1
System:
NodeJS : v16.14.0 (/Users/lincoln/.nvm/versions/node/v16.14.0/bin/node)
npm : 8.3.1
OS : macOS Monterey
Additional Information
None. Not sure if this issue is related: https://github.com/ionic-team/ionic-framework/issues/24179
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 1
- Comments: 15 (4 by maintainers)
Weird. Yeah looks like I pasted the wrong results for the P6. My pixel 6 shows the same as your 4a.
I confirm on the Pixel 7 pro my app is acting like Desktop => isDesktop is returned true.
Thanks for @vaibhav65577 for your temporary fix, I will try.
Any capacitor permanent update expected ?
For anyone who faces this issue, currently you can make temporary changes in app.module.ts and override methods which returns browser and mobile properties .
you can make changes in App.module file
Filed: https://bugs.chromium.org/p/chromium/issues/detail?id=1384181
I am also able to reproduce this using Pixel 7 through browserstack on https://hover-pointer-media-query.glitch.me: