From 9e78e2beea6f1da6e3e28a46d1730cc17eeed85a Mon Sep 17 00:00:00 2001 From: Jeremy Press Date: Mon, 7 Aug 2017 15:49:26 -0700 Subject: [PATCH] Fix: Disable font face for iOS 10.3.x (#283) --- src/lib/Browser.js | 6 +++--- src/lib/__tests__/Browser-test.js | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib/Browser.js b/src/lib/Browser.js index dd2e8b765..5e37947ff 100644 --- a/src/lib/Browser.js +++ b/src/lib/Browser.js @@ -314,12 +314,12 @@ class Browser { } /** - * Returns whether or not the device is running IOS 10.3.1 that has Font Ligature rendering issue. + * Returns whether or not the device is running IOS 10.3.x that has Font Ligature rendering issue. * - * @return {boolean} Whether device is running 10.3.1 + * @return {boolean} Whether device is running 10.3.x */ static isIOSWithFontIssue() { - return Browser.isIOS() && /(?:OS\s)10_3_1/i.test(userAgent); + return Browser.isIOS() && /(?:OS\s)10_3/i.test(userAgent); } } diff --git a/src/lib/__tests__/Browser-test.js b/src/lib/__tests__/Browser-test.js index d6f54f55b..d5d7c0358 100644 --- a/src/lib/__tests__/Browser-test.js +++ b/src/lib/__tests__/Browser-test.js @@ -462,20 +462,20 @@ describe('lib/Browser', () => { }); describe('isIOSWithFontIssue()', () => { - it('should return true if device is on ios and is OS 10.3.1', () => { - Browser.overrideUserAgent('iPhone OS 10_3_1 safari/2'); + it('should return true if device is on ios and is OS 10.3.XX', () => { + Browser.overrideUserAgent('iPhone OS 10_3_90 safari/2'); const hasIssue = Browser.isIOSWithFontIssue(); expect(hasIssue).to.be.true; }); - it('should return false if device is on ios and is not OS 10.3.1', () => { - Browser.overrideUserAgent('iPhone OS 10_3_2 safari/2'); + it('should return false if device is on ios and is not OS 10.3.XX', () => { + Browser.overrideUserAgent('iPhone OS 10_5_90 safari/2'); const hasIssue = Browser.isIOSWithFontIssue(); expect(hasIssue).to.be.false; }); it('should return false if device is on ios and is not mobile', () => { - Browser.overrideUserAgent('DesktopDevice OS 10_3_1 safari/18902374701347589235'); + Browser.overrideUserAgent('DesktopDevice OS 10_3_90 safari/18902374701347589235'); const hasIssue = Browser.isAndroid(); expect(hasIssue).to.be.false; });