Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Limit iOS font fix to 10.3.1 #225

Merged
merged 3 commits into from
Jul 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.X that has Font Ligature rendering issue.
* Returns whether or not the device is running IOS 10.3.1 that has Font Ligature rendering issue.
*
* @return {boolean} True if device is running IOS 10.3.x
* @return {boolean} Whether device is running 10.3.1
*/
static isIOSWithFontIssue() {
return Browser.isIOS() && /(?:OS\s)10_3/i.test(userAgent);
return Browser.isIOS() && /(?:OS\s)10_3_1/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.XX', () => {
Browser.overrideUserAgent('iPhone OS 10_3_90 safari/2');
it('should return true if device is on ios and is OS 10.3.1', () => {
Browser.overrideUserAgent('iPhone OS 10_3_1 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.XX', () => {
Browser.overrideUserAgent('iPhone OS 10_5_90 safari/2');
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');
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_90 safari/18902374701347589235');
Browser.overrideUserAgent('DesktopDevice OS 10_3_1 safari/18902374701347589235');
const hasIssue = Browser.isAndroid();
expect(hasIssue).to.be.false;
});
Expand Down