Skip to content

Commit

Permalink
Fix: Disable font face for iOS 10.3.x (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Press committed Aug 7, 2017
1 parent caf2922 commit 9e78e2b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/lib/Browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/lib/__tests__/Browser-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down

0 comments on commit 9e78e2b

Please sign in to comment.