Skip to content

Commit 3cfab14

Browse files
authored
Treat focusable as enumerated boolean SVG attribute (#13339)
* Treat focusable as enumerated boolean attribute * Update attribute table
1 parent a66217b commit 3cfab14

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

fixtures/attribute-behavior/AttributeTableSnapshot.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3587,8 +3587,8 @@
35873587
| `focusable=(integer)`| (changed)| `"1"` |
35883588
| `focusable=(NaN)`| (changed, warning)| `"NaN"` |
35893589
| `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"` |
35923592
| `focusable=(string 'true')`| (changed)| `"true"` |
35933593
| `focusable=(string 'false')`| (changed)| `"false"` |
35943594
| `focusable=(string 'on')`| (changed)| `"on"` |

packages/react-dom/src/shared/DOMProperty.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,12 @@ const properties = {};
260260
// In React, we let users pass `true` and `false` even though technically
261261
// these aren't boolean attributes (they are coerced to strings).
262262
// 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 => {
264269
properties[name] = new PropertyInfoRecord(
265270
name,
266271
BOOLEANISH_STRING,

0 commit comments

Comments
 (0)