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

fix(utils): Fix error in IE when getting scroll state on page with SVG elements #1820

Merged
merged 1 commit into from
Sep 24, 2019
Merged

fix(utils): Fix error in IE when getting scroll state on page with SVG elements #1820

merged 1 commit into from
Sep 24, 2019

Conversation

benbcai
Copy link
Contributor

@benbcai benbcai commented Sep 20, 2019

For any page in IE that has an SVG element, accessing .children on an SVGElement when getting the scroll state would return undefined and ends up throwing an exception. Other browsers treat SVGs as HTMLCollections but IE treats them as SVGElement.

Closes issue: #525

Reviewer checks

Required fields, to be filled out by PR reviewer(s)

  • Follows the commit message policy, appropriate for next version
  • Code is reviewed for security

@benbcai benbcai requested a review from a team as a code owner September 20, 2019 20:43
@CLAassistant
Copy link

CLAassistant commented Sep 20, 2019

CLA assistant check
All committers have signed the CLA.

@benbcai
Copy link
Contributor Author

benbcai commented Sep 24, 2019

@WilcoFiers @straker Could you please take a look at this pull request? This issue is breaking my tests and blocking by project.

@straker straker changed the title fix(core/utils): Fix error in IE when getting scroll state on page with SVG elements fix(utils): Fix error in IE when getting scroll state on page with SVG elements Sep 24, 2019
Copy link
Contributor

@straker straker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the reminder

@straker straker merged commit 9a32f6f into dequelabs:develop Sep 24, 2019
}
return scrolls.concat(getElmScrollRecursive(elm));
}, []);
return Array.from(root.children || root.childNodes || []).reduce(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm late to the party, but it would be nice to see a "SVGs in IE don't have .children" (or alike) comment here. Otherwise a future developer may not know what this is for.

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

Successfully merging this pull request may close these issues.

4 participants