<!-- Note: if the issue is about documentation or the website, please file it at: https://github.com/reactjs/reactjs.org/issues/new --> **Do you want to request a *feature* or report a *bug*?** Bug **What is the current behavior?** We have an `onClick` handler on an SVG element. The handler sets a state property that causes the element to be hidden (via CSS). This makes IE11 throw on this line: https://github.com/facebook/react/blob/52eb59dda2eb0d9afe3a18aacd6142c1d2f7ee25/packages/react-dom/src/client/ReactInputSelection.js#L72 It seems that #11800 removed a try/catch protection for this. I am working around the problem by stubbing focus like this: ```javascript if (typeof SVGElement.prototype.focus === 'undefined') { SVGElement.prototype.focus = function () {}; } ``` **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** Worked in 16.2.2
Activity
jquense commentedon May 8, 2018
Can you put together a reproduction demonstrating the issue?
gaearon commentedon May 8, 2018
In the meantime please feel free to send a PR adding try-catch with an explanation comment
ThaddeusJiang commentedon Jun 7, 2018
I hava a same problem.
React 16.4
gaearon commentedon Jun 7, 2018
@ThaddeusJiang That doesn't help us in any way. It will help us if you provide a reproducing case. Thanks.
gaearon commentedon Jun 7, 2018
Can somebody with IE11 figure out if:
focus()in IE11focus()call throws on hidden elementskristiandupont commentedon Jun 7, 2018
Sorry, I forgot about this because my workaround solved it for me. I will make a PR and try to figure out if it applies to other classes as well
gaearon commentedon Jun 7, 2018
Thanks!
ThaddeusJiang commentedon Jun 8, 2018
@gaearon
when user drags a Element, 'focus' is not supported Exception be thrown
Environment
gaearon commentedon Jun 8, 2018
OK. Somebody want to send a PR that reverts #11800?
ThaddeusJiang commentedon Jun 8, 2018
Yes, I do.
gaearon commentedon Jun 11, 2018
Fixed in #12996
Fix an SVG focusing crash in IE11 (#12996)
gaearon commentedon Jun 13, 2018
Fixed in React 16.4.1.
Fix an SVG focusing crash in IE11 (react#12996)
Fix an SVG focusing crash in IE11 (react#12996)