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

Missing Array.find error in IE11 #9

Closed
smathson opened this issue Jun 5, 2019 · 2 comments
Closed

Missing Array.find error in IE11 #9

smathson opened this issue Jun 5, 2019 · 2 comments

Comments

@smathson
Copy link

smathson commented Jun 5, 2019

I see PR #4 removed usages of Array.find to make this library safe for older browsers without using a polyfill. Looks like a new usage made it's way back in here: https://github.com/theKashey/focus-lock/blob/master/src/focusMerge.js#L102

Is no polyfills for older browsers still a goal of this library? If so, I'm happy to put a PR together to resolve this issue. Thanks!

@theKashey
Copy link
Owner

Please help me with it If you can easily test the result. I recently migrated to a new laptop, and lost all the virtual machines I've had.

Probably the following code would work, and would work better than the existing one:

const reorderNodes = (srcNodes, dstNodes) => {
  const dest = new Set();
  dstNodes.forEach(node => dest.add(node)); // no Map(dstNodes) for IE11 :(
  return  srcNodes.filter(node => dest.has(node);
};

@theKashey
Copy link
Owner

released in [email protected]

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

No branches or pull requests

2 participants