Accessibility · Middle · Question 70 of 75
Why can changing a list key lose keyboard focus?
- 1Keys are read by screen readers and change the name
- 2Browsers reset all focus whenever a key is rendered
- 3React remounts the node, destroying the focused element
Show the answer
Correct answer: React remounts the node, destroying the focused element
Explanation
A new key means a new DOM element, so focus falls to body. Keep keys stable.