react-selectrix icon indicating copy to clipboard operation
react-selectrix copied to clipboard

Object.entries doesn't work in older browsers

Open karataev opened this issue 7 years ago • 2 comments

file src/helpers/index.js contains ES2017 Object.entries method which doesn't work in Safari 9. Suggestion: refactor to make the code works in older browsers.

karataev avatar Jun 28 '18 10:06 karataev

Hi,

We should use a polyfill instead of refactoring. Object.entries is not the only code that have issue with legacy browsers, so maybe babel-polyfill is an option, but we should check how much the bundle size will be increased.

If you have the time, a pull request will be great. Many thanks

stratos-vetsos avatar Jun 29 '18 09:06 stratos-vetsos

Yep, I used Object.entries polyfill to make the package work in older browsers. In my case (Safari 9) Object.entries was the only thing which had to be polyfilled. The rest of the code works as expected with no errors. Here's the polyfill I used to solve the problem (for anyone with the same issue): https://stackoverflow.com/a/45851440/5476578

Thanks for the great library!

karataev avatar Jul 02 '18 15:07 karataev