Skip to content

Commit

Permalink
fix: IS_IPAD should be false on iPhone (#6371)
Browse files Browse the repository at this point in the history
Safari user agent. However, the new check also returns true for iPhones.
Therefore, we should exclude iPhones from the check.
  • Loading branch information
gkatsev committed Dec 24, 2019
1 parent 274299b commit 917d898
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/js/utils/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ export const TOUCH_ENABLED = Dom.isReal() && (
* @const
* @type {Boolean}
*/
export const IS_IPAD = (/iPad/i).test(USER_AGENT) || (IS_SAFARI && TOUCH_ENABLED);
export const IS_IPAD = (/iPad/i).test(USER_AGENT) ||
(IS_SAFARI && TOUCH_ENABLED && !(/iPhone/i).test(USER_AGENT));

/**
* Whether or not this device is an iPhone.
Expand Down

0 comments on commit 917d898

Please sign in to comment.