duskload / react-device-detect

Detect device, and render view according to detected device type.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

isMobile is true for bigger screen

arunpugahz opened this issue · 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

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

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.