Skip to content

Commit 8debf52

Browse files
authored
Revert "Add unknown property warning for use of autofocus" (facebook#7684)
1 parent 73c50e7 commit 8debf52

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

src/renderers/dom/shared/HTMLDOMPropertyConfig.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var HTMLDOMPropertyConfig = {
4141
async: HAS_BOOLEAN_VALUE,
4242
autoComplete: 0,
4343
// autoFocus is polyfilled/normalized by AutoFocusUtils
44-
autoFocus: HAS_BOOLEAN_VALUE,
44+
// autoFocus: HAS_BOOLEAN_VALUE,
4545
autoPlay: HAS_BOOLEAN_VALUE,
4646
capture: HAS_BOOLEAN_VALUE,
4747
cellPadding: 0,
@@ -205,7 +205,6 @@ var HTMLDOMPropertyConfig = {
205205
},
206206
DOMAttributeNames: {
207207
acceptCharset: 'accept-charset',
208-
autoFocus: 'autofocus',
209208
className: 'class',
210209
htmlFor: 'for',
211210
httpEquiv: 'http-equiv',

src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,22 +1495,5 @@ describe('ReactDOMComponent', () => {
14951495
//since hard coding the line number would make test too brittle
14961496
expect(parseInt(previousLine, 10) + 12).toBe(parseInt(currentLine, 10));
14971497
});
1498-
1499-
it('should suggest property name if available', () => {
1500-
spyOn(console, 'error');
1501-
1502-
ReactTestUtils.renderIntoDocument(React.createElement('label', {for: 'test'}));
1503-
ReactTestUtils.renderIntoDocument(React.createElement('input', {type: 'text', autofocus: true}));
1504-
1505-
expect(console.error.calls.count()).toBe(2);
1506-
1507-
expect(console.error.calls.argsFor(0)[0]).toBe(
1508-
'Warning: Unknown DOM property for. Did you mean htmlFor?\n in label'
1509-
);
1510-
1511-
expect(console.error.calls.argsFor(1)[0]).toBe(
1512-
'Warning: Unknown DOM property autofocus. Did you mean autoFocus?\n in input'
1513-
);
1514-
});
15151498
});
15161499
});

0 commit comments

Comments
 (0)