From 9a3701e80ed94af70e43ac5ed6dcf38ed918d38d Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Tue, 7 Aug 2018 10:10:28 +0100 Subject: [PATCH 1/2] Treat focusable as enumerated boolean attribute --- packages/react-dom/src/shared/DOMProperty.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/react-dom/src/shared/DOMProperty.js b/packages/react-dom/src/shared/DOMProperty.js index 23a00b48a59..cef4609497f 100644 --- a/packages/react-dom/src/shared/DOMProperty.js +++ b/packages/react-dom/src/shared/DOMProperty.js @@ -260,7 +260,12 @@ const properties = {}; // In React, we let users pass `true` and `false` even though technically // these aren't boolean attributes (they are coerced to strings). // Since these are SVG attributes, their attribute names are case-sensitive. -['autoReverse', 'externalResourcesRequired', 'preserveAlpha'].forEach(name => { +[ + 'autoReverse', + 'externalResourcesRequired', + 'focusable', + 'preserveAlpha', +].forEach(name => { properties[name] = new PropertyInfoRecord( name, BOOLEANISH_STRING, From df141f86e5d67f49a23295afe9240944b6b77280 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Tue, 7 Aug 2018 19:39:07 +0100 Subject: [PATCH 2/2] Update attribute table --- fixtures/attribute-behavior/AttributeTableSnapshot.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fixtures/attribute-behavior/AttributeTableSnapshot.md b/fixtures/attribute-behavior/AttributeTableSnapshot.md index d0fa5f567f5..62dc25d7771 100644 --- a/fixtures/attribute-behavior/AttributeTableSnapshot.md +++ b/fixtures/attribute-behavior/AttributeTableSnapshot.md @@ -3587,8 +3587,8 @@ | `focusable=(integer)`| (changed)| `"1"` | | `focusable=(NaN)`| (changed, warning)| `"NaN"` | | `focusable=(float)`| (changed)| `"99.99"` | -| `focusable=(true)`| (initial, warning)| `` | -| `focusable=(false)`| (initial, warning)| `` | +| `focusable=(true)`| (changed)| `"true"` | +| `focusable=(false)`| (changed)| `"false"` | | `focusable=(string 'true')`| (changed)| `"true"` | | `focusable=(string 'false')`| (changed)| `"false"` | | `focusable=(string 'on')`| (changed)| `"on"` |