react-device-detect icon indicating copy to clipboard operation
react-device-detect copied to clipboard

isMobile is true for bigger screen

Open arunpugahz opened this issue 3 years ago • 2 comments

  1. Bug description I use this package for my React application. When I open the website on a large screen, the value of deviceType is mobile and isMobile is set to true which affects the use case of these helpers
  2. Steps to reproduce You can debug in chrome using responsive window and set the width to 3740 and height to 1720
  3. Device/Browser type/name Chrome my chrome window Screenshot 2021-11-11 at 10 51 17 PM

My console statement on componentDidMount Screenshot 2021-11-11 at 10 45 44 PM

Kindly fix this issue As soon as possible

arunpugahz avatar Nov 11 '21 17:11 arunpugahz

Either ChromDevtools responsive feature is providing mobile userAgent or this library has got a bug in its parsing.

But: if you disable DevTools responsive feature, and resize the whole browser window, it works as expected. So for the time being, do not use DevTools to test mobile devices

Mukhammadali avatar Dec 14 '21 10:12 Mukhammadali

Make sure to toggle off the 'toggle device toolbar', on the top of the chrome devtools. (Button looks like a tablet and phone). For some reason if you have this open, even if you are in responsive mode, the agent will say you are on a mobile device.

ryanweiler92 avatar Sep 02 '22 16:09 ryanweiler92