Skip to content
This repository was archived by the owner on Apr 4, 2019. It is now read-only.

Commit 2958e0e

Browse files
committed
Merge pull request #400 from jayphelps/autocorrect-attr
[BUGFIX] add `autocorrect` attr override because Mobile Safari hates us
2 parents 47fea4b + d3642f5 commit 2958e0e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

packages/dom-helper/lib/prop.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ var ATTR_OVERRIDES = {
5353
// Some version of IE (like IE9) actually throw an exception
5454
// if you set input.type = 'something-unknown'
5555
type: true,
56-
form: true
56+
form: true,
57+
// Chrome 46.0.2464.0: 'autocorrect' in document.createElement('input') === false
58+
// Safari 8.0.7: 'autocorrect' in document.createElement('input') === false
59+
// Mobile Safari (iOS 8.4 simulator): 'autocorrect' in document.createElement('input') === true
60+
autocorrect: true
5761
},
5862

5963
// element.form is actually a legitimate readOnly property, that is to be

packages/dom-helper/tests/prop-test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ import { normalizeProperty } from 'dom-helper/prop';
33
QUnit.module('dom-helper prop');
44

55
test('type.attr, for element props that for one reason or another need to be treated as attrs', function() {
6-
expect(12);
6+
expect(13);
77

88
[
99
{ tagName: 'TEXTAREA', key: 'form' },
1010
{ tagName: 'BUTTON', key: 'type' },
1111
{ tagName: 'INPUT', key: 'type' },
1212
{ tagName: 'INPUT', key: 'list' },
1313
{ tagName: 'INPUT', key: 'form' },
14+
{ tagName: 'INPUT', key: 'autocorrect' },
1415
{ tagName: 'OPTION', key: 'form' },
1516
{ tagName: 'INPUT', key: 'form' },
1617
{ tagName: 'BUTTON', key: 'form' },

0 commit comments

Comments
 (0)