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(loaders): fix Dot loader for IE11 #936

Merged
merged 3 commits into from
Nov 17, 2020
Merged

fix(loaders): fix Dot loader for IE11 #936

merged 3 commits into from
Nov 17, 2020

Conversation

hzhu
Copy link
Contributor

@hzhu hzhu commented Nov 16, 2020

Description

This pull request fixes the Dot loader animation in Internet Explorer 11.

Detail

It looks like useCSSSVGAnimation is unreliable in determining if an SVG can be animated. In both Chrome 86 and Internet Explorer, useCSSSVGAnimation returns the same result. This is unexpected because Internet Explorer does not support SVG animations.

This PR removes useCSSSVGAnimation and replaces it with a working SVG animation check. It checks the transform property of the svg element to determine if SVG can be animated. In modern Chrome, Safari, Firefox, and Edge this check returns true indicating animation is supported. In IE11, the check returns false indicating the animation is not supported.

By using the correct boolean check, the Dot loader animates correctly across all browsers that are supported by Garden.

Verification Steps

Before:

  1. Open Internet Explorer 11
  2. Navigate to the Dot loader Storybook example on the production site here
  3. The Dot loader does not animate

After:

  1. Open Internet Explorer 11
  2. Navigate to the Dot loader Storybook example on the "View Deployment" site here
  3. The Dot loader does animate

Screenshots

Before:
2020-11-16 11 21 22

After:
2020-11-16 11 19 58

Checklist

  • ⬅️ renders as expected with reversed (RTL) direction
  • 🤘 renders as expected with Bedrock CSS (?bedrock)
  • ♿ analyzed via axe and evaluated using VoiceOver
  • 💂‍♂️ includes new unit tests
  • 📝 tested in Chrome, Firefox, Safari, Edge, and IE11

This commit removes useCSSSVGAnimation because it was returning the same results for
Chrome 86 and Internet Explorer 11. This should not be the case as SVG animations
do not work on IE11. Instead, a simplier SVG transform check is used.
@hzhu hzhu self-assigned this Nov 16, 2020
@coveralls
Copy link

coveralls commented Nov 16, 2020

Coverage Status

Coverage decreased (-0.003%) to 95.818% when pulling 7ecf4ab on hzhu/dots-ie11 into 7a99c96 on main.

@zendesk-garden zendesk-garden temporarily deployed to staging November 16, 2020 20:40 Inactive
@hzhu hzhu marked this pull request as ready for review November 16, 2020 20:44
@hzhu hzhu requested a review from a team as a code owner November 16, 2020 20:44
@hzhu hzhu merged commit e6df514 into main Nov 17, 2020
@hzhu hzhu deleted the hzhu/dots-ie11 branch November 17, 2020 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

5 participants