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 tabs component throwing JavaScript errors in Internet Explorer 8 #1678

Merged
merged 2 commits into from
Dec 20, 2019

Conversation

NickColley
Copy link
Contributor

@NickColley NickColley commented Dec 11, 2019

In Internet Explorer 8 errors are thrown when checking the nodeType as nextSibling is undefined, so to fix this issue I've reverted to a previous version of the code.

We previously updated this pull request to mirror a pull request in the polyfill-service repository for consistency here: 4997c72

Interestingly these polyfills are not in the new library so I cannot upstream this fix but I've raised an issue to see why they did not port it to the new library: https://github.com/Financial-Times/polyfill-library/issues/338

Fixes #1490

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-1678 December 11, 2019 17:56 Inactive
@NickColley NickColley added this to the Next milestone Dec 11, 2019
@NickColley NickColley force-pushed the fix-tabs-in-ie8-erroring branch from 578331a to 9ac8d4c Compare December 11, 2019 18:07
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-1678 December 11, 2019 18:07 Inactive
Copy link
Member

@hannalaakso hannalaakso left a comment

Choose a reason for hiding this comment

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

Thanks @NickColley . This matches previousElementSibling and nextElementSibling in MDN web docs.

In Internet Explorer 8 errors are thrown when checking the nodeType as nextSibiling is undefined, so to fix this issue we should first check if there is a next sibiling which matches the conditional in the while loop.

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

Successfully merging this pull request may close these issues.

Script error in IE8 when trying to navigate past the first or last tab using arrow keys
3 participants