Treat focusable as enumerated boolean SVG attribute (#13339)
* Treat focusable as enumerated boolean attribute * Update attribute table
Dan Abramov committed
Aug 7, 2018 at 19:39 UTC
3cfab14b96a55d53ba5784a9915b8c1660da08be
2 files changed
+8
-3
fixtures/attribute-behavior/AttributeTableSnapshot.md
+2
-2
@@ -3587,8 +3587,8 @@
3587
| `focusable=(integer)`| (changed)| `"1"` |
3588
| `focusable=(NaN)`| (changed, warning)| `"NaN"` |
3589
| `focusable=(float)`| (changed)| `"99.99"` |
3590
-| `focusable=(true)`| (initial, warning)| `<null>` |
3591
-| `focusable=(false)`| (initial, warning)| `<null>` |
3590
+| `focusable=(true)`| (changed)| `"true"` |
3591
+| `focusable=(false)`| (changed)| `"false"` |
3592
| `focusable=(string 'true')`| (changed)| `"true"` |
3593
| `focusable=(string 'false')`| (changed)| `"false"` |
3594
| `focusable=(string 'on')`| (changed)| `"on"` |
packages/react-dom/src/shared/DOMProperty.js
+6
-1
@@ -260,7 +260,12 @@ const properties = {};
260
// In React, we let users pass `true` and `false` even though technically
261
// these aren't boolean attributes (they are coerced to strings).
262
// Since these are SVG attributes, their attribute names are case-sensitive.
263
-['autoReverse', 'externalResourcesRequired', 'preserveAlpha'].forEach(name => {
263
+[
264
+ 'autoReverse',
265
+ 'externalResourcesRequired',
266
+ 'focusable',
267
+ 'preserveAlpha',
268
+].forEach(name => {
269
properties[name] = new PropertyInfoRecord(
270
name,
271
BOOLEANISH_STRING,