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

Fixed HTMLCollection issue with older versions of Edge and IE #135

Merged

Conversation

mathieumg
Copy link
Contributor

Fixed issue where iterating an HTMLCollection would cause issues in older versions of Edge and IE.

@wojtekmaj
Copy link
Owner

wojtekmaj commented Mar 23, 2019

Hi @mathieumg,
these lines:

      // Wrapper was directly clicked
      const [/* nativeInput */, firstInput] = event.target.children;
      focus(firstInput);

are transpiled by Babel:

        // Wrapper was directly clicked
        var _event$target$childre = _slicedToArray(event.target.children, 2),

        /* nativeInput */
        firstInput = _event$target$childre[1];

        focus(firstInput);

So I don't see how it could become a problem in production?

@mathieumg
Copy link
Contributor Author

Yes, and the _slicedToArray utility ultimately iterates on event.target.children, which is a HTMLCollection. (Not iterable in Edge until version 17)

@wojtekmaj
Copy link
Owner

Ah, I understand now! Thank you for the explanation and sorry to keep you waiting.

@wojtekmaj wojtekmaj merged commit 9296355 into wojtekmaj:master Mar 23, 2019
@wojtekmaj
Copy link
Owner

Added this to React-DateTime-Picker and React-Time-Picker too, marking you as co-author. :)

@mathieumg
Copy link
Contributor Author

No problem, thank you! 😎

@mathieumg mathieumg deleted the bugfix_no-destructure-htmlcollection branch March 24, 2019 05:00
@wojtekmaj wojtekmaj added the bug Something isn't working label Mar 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants