question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BrowserView, MobileView, TabletView shows on iPad at the same time

See original GitHub issue
  1. Bug description BrowserView, MobileView, TabletView shows on iPad at the same time
  2. Steps to reproduce Add BrowserView, MobileView, TabletView into react component, start iPad simulator on macOS, open page in safari
  3. Device user-agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Safari/605.1.15" I used this user-agent in desktop chrome and the issue is not appearing.
  4. Device/Browser type/name Safari on iPad simulator, iPad (8th generation), and all pro versions with ipadOS 14
  5. Share code for a better understanding (for example, here https://codesandbox.io/s/new) https://codesandbox.io/s/priceless-williamson-r8xug?file=/src/App.js
  6. Any additional info Screen Shot 2020-10-08 at 11 13 58 AM

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:6
  • Comments:5

github_iconTop GitHub Comments

2reactions
artmsvcommented, Oct 13, 2020

@matthew9510 As you can see from the screenshot isTablet = true for tablets and false for mobile and desktops. So I used {!isTablet && <BrowserView/> } in this case it will show proper view on each platform

0reactions
sinnbeckcommented, Jan 11, 2021

I fixed it by making my own BrowserView which I import instead of the original one

import React from 'react';
import {CustomView, isBrowser, isTablet} from "react-device-detect";

export default function BrowserView ({children, ...props}) {
    return (
        <CustomView condition={isBrowser && !isTablet} {...props}>
            {children}
        </CustomView>
    )
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Mobile device detect and switch render view in React - Morioh
react-device-detect: Detect device and render view according to detected device type with ... import { BrowserView, MobileView, isBrowser, isMobile } from ...
Read more >
Customize your Safari settings on iPad
In Safari on iPad, you can customize your start page, change the text size on websites, and change display and privacy settings.
Read more >
ReactJS: How to determine if the application is being ...
import {BrowserView, MobileView} from 'react-device-detect'; const MyComponent = () => { return ... I'd created a hook as below and it works like...
Read more >
How to View Mobile Version of Website: In Just 3 Clicks
We'll show you how to do that for any website, as well as your own ... a phone and tablet icon) and click...
Read more >
Mattermost legacy self-hosted changelog
Removed real-time updates of a couple of features to prevent overloading servers on user ... Focalboard: Grouped Table view, New properties, and More...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found