@samitouri / QOS-React / commits / 8debf524df

Revert "Add unknown property warning for use of `autofocus`" (#7684)

Paul O’Shannessy committed Sep 8, 2016 at 13:43 UTC 8debf524df0d7e96895ff7bfab29c6c340ee5e1e
2 files changed +1 -19
src/renderers/dom/shared/HTMLDOMPropertyConfig.js
+1 -2
@@ -41,7 +41,7 @@ var HTMLDOMPropertyConfig = {
41 async: HAS_BOOLEAN_VALUE,
42 autoComplete: 0,
43 // autoFocus is polyfilled/normalized by AutoFocusUtils
44 - autoFocus: HAS_BOOLEAN_VALUE,
44 + // autoFocus: HAS_BOOLEAN_VALUE,
45 autoPlay: HAS_BOOLEAN_VALUE,
46 capture: HAS_BOOLEAN_VALUE,
47 cellPadding: 0,
@@ -205,7 +205,6 @@ var HTMLDOMPropertyConfig = {
205 },
206 DOMAttributeNames: {
207 acceptCharset: 'accept-charset',
208 - autoFocus: 'autofocus',
208 className: 'class',
209 htmlFor: 'for',
210 httpEquiv: 'http-equiv',
src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
-17
@@ -1495,22 +1495,5 @@ describe('ReactDOMComponent', () => {
1495 //since hard coding the line number would make test too brittle
1496 expect(parseInt(previousLine, 10) + 12).toBe(parseInt(currentLine, 10));
1497 });
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 - });
1498 });
1499 });