-
Notifications
You must be signed in to change notification settings - Fork 47.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix tabIndex attribute for SVG #11033
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10768,7 +10768,7 @@ | |
| `tabIndex=(string 'false')`| (initial)| `<number: -1>` | | ||
| `tabIndex=(string 'on')`| (initial)| `<number: -1>` | | ||
| `tabIndex=(string 'off')`| (initial)| `<number: -1>` | | ||
| `tabIndex=(symbol)`| (initial, warning)| `<number: -1>` | | ||
| `tabIndex=(symbol)`| (initial, warning, ssr error, ssr mismatch)| `<number: -1>` | | ||
| `tabIndex=(function)`| (initial, warning)| `<number: -1>` | | ||
| `tabIndex=(null)`| (initial)| `<number: -1>` | | ||
| `tabIndex=(undefined)`| (initial)| `<number: -1>` | | ||
|
@@ -10781,19 +10781,19 @@ | |
| `tabIndex=(array with string)`| (initial)| `<number: -1>` | | ||
| `tabIndex=(empty array)`| (initial)| `<number: -1>` | | ||
| `tabIndex=(object)`| (initial)| `<number: -1>` | | ||
| `tabIndex=(numeric string)`| (initial, ssr mismatch)| `<number: -1>` | | ||
| `tabIndex=(numeric string)`| (changed)| `<number: 42>` | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This shows it worked. |
||
| `tabIndex=(-1)`| (initial)| `<number: -1>` | | ||
| `tabIndex=(0)`| (initial, ssr mismatch)| `<number: -1>` | | ||
| `tabIndex=(integer)`| (initial, ssr mismatch)| `<number: -1>` | | ||
| `tabIndex=(0)`| (changed)| `<number: 0>` | | ||
| `tabIndex=(integer)`| (changed)| `<number: 1>` | | ||
| `tabIndex=(NaN)`| (initial, warning)| `<number: -1>` | | ||
| `tabIndex=(float)`| (initial, ssr mismatch)| `<number: -1>` | | ||
| `tabIndex=(float)`| (changed)| `<number: 99>` | | ||
| `tabIndex=(true)`| (initial, warning)| `<number: -1>` | | ||
| `tabIndex=(false)`| (initial, warning)| `<number: -1>` | | ||
| `tabIndex=(string 'true')`| (initial)| `<number: -1>` | | ||
| `tabIndex=(string 'false')`| (initial)| `<number: -1>` | | ||
| `tabIndex=(string 'on')`| (initial)| `<number: -1>` | | ||
| `tabIndex=(string 'off')`| (initial)| `<number: -1>` | | ||
| `tabIndex=(symbol)`| (initial, warning)| `<number: -1>` | | ||
| `tabIndex=(symbol)`| (initial, warning, ssr error, ssr mismatch)| `<number: -1>` | | ||
| `tabIndex=(function)`| (initial, warning)| `<number: -1>` | | ||
| `tabIndex=(null)`| (initial)| `<number: -1>` | | ||
| `tabIndex=(undefined)`| (initial)| `<number: -1>` | | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1243,6 +1243,19 @@ describe('ReactDOMServerIntegration', () => { | |
); | ||
}); | ||
|
||
itRenders('svg element with a tabIndex attribute', async render => { | ||
let e = await render(<svg tabIndex="1" />); | ||
expect(e.tabIndex).toBe(1); | ||
}); | ||
|
||
itRenders( | ||
'svg element with a badly cased tabIndex attribute', | ||
async render => { | ||
let e = await render(<svg tabindex="1" />, 1); | ||
expect(e.tabIndex).toBe(1); | ||
}, | ||
); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this expected to work if SVG is case sensitive? I see that there is a warning, but how does it actually get set? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might differ in another browser, but a quick check in Chrome shows that it works, and it gets assigned as |
||
|
||
itRenders('a math element', async render => { | ||
const e = await render(<math />); | ||
expect(e.childNodes.length).toBe(0); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
ssr error, ssr mismatch
for Symbols doesn’t sound great, but it’s an existing issue with SVG attributes (you can search the file for many more matches). We should fix that separately.