reactjs / react-modal

Accessible modal dialog component for React
http://reactcommunity.org/react-modal
MIT License
7.37k stars 809 forks source link

Internet Explorer problem #465

Open relense opened 7 years ago

relense commented 7 years ago

Im using the modal and everything is okay in every browser except for IE.

Im' using Internet Explorer 11 to test and when I try and use it does nothing.

Anyone had this issue or know what it might be?

diasbruno commented 7 years ago

Hi @relense, any information on the console? Which version of react-modal are using?

relense commented 7 years ago

Hey, Im using the 1.9.7 version of react modal. There are no console log everything looks fine. This happens after I use react-file-reader-input. After the user chooses a foto it should trigger the onChange function. But for some reason in ie 11 doesn't do anything.

tansongyang commented 7 years ago

I might be having the same issue. In IE11, I get a syntax error. After some investigation, I found this in lib/components/Modal.js:

  getDefaultProps: function () {
    return {
      isOpen: false,
      portalClassName: 'ReactModalPortal',
      ariaHideApp: true,
      closeTimeoutMS: 0,
      shouldCloseOnOverlayClick: true,
      parentSelector: () => document.body
    };
  },

You can see that parentSelector is an arrow function, which is unsupported in IE11.

I've seen this on versions 2.0.1, 1.9.7, and 1.6.0.

diasbruno commented 7 years ago

@tansongyang Probably a missing transform :(. Can you validate if this happens on versions 2.0.1+?

tansongyang commented 7 years ago

@diasbruno The issue appears to go away in 2.2.2. Would you like me to check other versions as well?

diasbruno commented 7 years ago

@relense @tansongyang Awesome. If you have sometime to have a look on this, you can check if versions 2.2.1 is ok, if so, update to the versions 2.x.y of react-modal is the best fix.

@tansongyang Thank you.

relense commented 7 years ago

Thanks all for the help, even with the update it didnt work. Ill try something else. If I solve it, ill comment here

diasbruno commented 7 years ago

@relense You can check if there is any cache on npm or something (after the update) or if you can get a small example showing the issue it would help.

tansongyang commented 7 years ago

@diasbruno 2.2.1 works for me as well.

diasbruno commented 7 years ago

@tansongyang Thank you!

doctor3397 commented 5 years ago

I have react-modal 3.10.1 and I'm also running into the issue where the Modal is not rendering on IE. Any suggestion? Thank you.

doctor3397 commented 5 years ago

Thanks all for the help, even with the update it didnt work. Ill try something else. If I solve it, ill comment here

Hi @relense, did you resolve this issue? I'm running into the same problem and I'm using react-modal 3.10.1

diasbruno commented 5 years ago

Hi @doctor3397, can you confirm that the dom elements of the modal are been rendered, please?

doctor3397 commented 5 years ago

Hi @diasbruno, the IE issue is now resolved after I updated the babel.config.js and the webpack.config.js files. Thank you for your help.

diasbruno commented 5 years ago

@doctor3397 Thanks! Probably we are building with some javascript features that are not available on IE (?). Have you added any plugins on your babel configuration?

linzhu02 commented 5 years ago

Hi @doctor3397 , do you mind share what updates you have to make on babel.config.js and webpack.config.js files?

I am having the same issue and also using react-modal 3.10.1 Thanks!

@diasbruno Do you know how to fix this?

doctor3397 commented 5 years ago

Hi @linzhu02, @diasbruno I added @babel/polyfill and browserslist to package.json file. Hope this helps!