Skip to content
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

v6.4.0: IE11 - Closing modal throws exception for SVG trigger elements #1208

Closed
kryops opened this issue Sep 9, 2018 · 0 comments · Fixed by #1212 or #1247
Closed

v6.4.0: IE11 - Closing modal throws exception for SVG trigger elements #1208

kryops opened this issue Sep 9, 2018 · 0 comments · Fixed by #1212 or #1247
Labels

Comments

@kryops
Copy link

kryops commented Sep 9, 2018

  • components: Modal
  • reactstrap version 6.4.0
  • import method es
  • react version tested with 16.4.2 and 16.5.0
  • bootstrap version 4.1.3
  • affected browser: At least IE11, works fine in Chrome

This looks like a regression caused by #1175 in v6.4.0. Downgrading to 6.3.1 solved the issue.

What is happening?

After closing a modal that was opened by a SVG icon trigger, IE11 throws the following exception:

TypeError: Object doesn't support property or method 'focus'

What should be happening?

The modal should always close without throwing an exception :)

Possible solutions could be:

  • Checking if the triggering element supports the focus() method
  • surrounding with try-catch

Steps to reproduce issue

  1. Open a Modal in IE11 while document.activeElement points to a SVG element
  2. Close the Modal

Error message in console

TypeError: Object doesn't support property or method 'focus'
(http://localhost:8011/frontend/lib/main.js:59524:9) at wrappedMethod
(http://localhost:8011/frontend/lib/main.js:46950:7) at componentWillUnmount
(http://localhost:8011/frontend/lib/main.js:59390:9) at wrappedMethod
(http://localhost:8011/frontend/lib/main.js:46940:7) at callComponentWillUnmountWithTimer
(http://localhost:8011/frontend/lib/main.js:43163:3) at callCallback
(http://localhost:8011/frontend/lib/main.js:28982:9)

My IE doesn't seem to like my source maps :-/

I followed the exception here:

this._triggeringElement.focus();

Code

https://stackblitz.com/edit/reactstrap-px6c8z?file=Example.js

Thanks for looking into it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants