Skip to content

Commit

Permalink
fix: fix ipad recognition (#4632)
Browse files Browse the repository at this point in the history
  • Loading branch information
fifoosid authored Jan 26, 2022
1 parent 604ce63 commit c0cc73d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/base/hash.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
U086uAbpTzMpjyqJA4gs6NyEWlE=
G0cPfXX82+g9TmNiNriZZWFqVhY=
5 changes: 4 additions & 1 deletion packages/base/src/Device.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ const windows = navigator.platform.indexOf("Win") !== -1;
const iOS = navigator.platform.match(/iPhone|iPad|iPod/) || (navigator.userAgent.match(/Mac/) && "ontouchend" in document);
const android = !windows && /Android/.test(ua);
const androidPhone = android && /(?=android)(?=.*mobile)/i.test(ua);
const ipad = /ipad/i.test(ua);
const ipad = /ipad/i.test(ua) || (/Macintosh/i.test(ua) && "ontouchend" in document);
// With iOS 13 the string 'iPad' was removed from the user agent string through a browser setting, which is applied on all sites by default:
// "Request Desktop Website -> All websites" (for more infos see: https://forums.developer.apple.com/thread/119186).
// Therefore the OS is detected as MACINTOSH instead of iOS and the device is a tablet if the Device.support.touch is true.

let windowsVersion;
let webkitVersion;
Expand Down

0 comments on commit c0cc73d

Please sign in to comment.