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

FAB: Material icon font not vertically centered in IE 11...sometimes? #2752

Closed
kfranqueiro opened this issue May 17, 2018 · 4 comments · Fixed by #2827
Closed

FAB: Material icon font not vertically centered in IE 11...sometimes? #2752

kfranqueiro opened this issue May 17, 2018 · 4 comments · Fixed by #2827
Labels

Comments

@kfranqueiro
Copy link
Contributor

What MDC Web Version are you using?

0.35.1

What browser(s) is this bug affecting?

IE 11

What OS are you using?

Win 10

What are the steps to reproduce the bug?

  • Run npm run dev and view fab.html in IE 11
  • Or run npm start and view mdc-fab/classes/baseline.html in IE 11

What is the expected behavior?

FAB icons should be centered both horizontally and vertically

What is the actual behavior?

FAB icons are off-center vertically; they're too high up. As of #2715, you can see that the icon's bounding box looks centered, but the icon is not centered within its bounding box.

Example from fab.html:

image

Any other information you believe would be useful?

A few baffling complications, which have been driving me crazy and making me question reality:

In other words, this issue seems inconsistent and I haven't figured out what the kicker is as to when it is and isn't reproducible.

@kfranqueiro
Copy link
Contributor Author

We also ran into a similar issue in Icon Button while reviewing #2748. What's interesting is the issue presented itself when using Material Icons, but not when using Font Awesome. It also corrects itself when instantiating JS for icon button toggles.

I suspect we have some IE flake specifically with the Material Icons font. I'm going to attempt to reduce a test case to show the Icons team.

@kfranqueiro
Copy link
Contributor Author

Okay, I finally got to the bottom of this.

This happens specifically when there is trailing whitespace within the material-icons element. It also happens with Font Awesome if you put space inside its element.

Reduced example.

I guess we can try to ensure that our demos and READMEs avoid spaces within material-icons elements. This is presumably a non-issue for the Catalog because surrounding whitespace is being shed during JSX compilation.

I'll notify the icons team of this, but I'm not sure whether it's resolvable (or worth resolving).

@acdvorak
Copy link
Contributor

Should we mention this in the READMEs of all components that use material-icons (button, FAB, extended FAB, icon toggle, etc.)?

@kfranqueiro
Copy link
Contributor Author

kfranqueiro commented May 22, 2018

I have a branch in progress that does that for FAB (I'm waiting on your screenshot test PRs to get in before I PR it so I can update goldens). I think Will is going to handle it for the new icon button package.

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