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(avatar): Fix misalignment on ie11 #676

Merged

Conversation

alexandrzavalii
Copy link
Contributor

@alexandrzavalii alexandrzavalii commented May 25, 2020

Summary

fixes: #675

Checklist

  • branch has been rebased on the latest master commit
  • tests are changed or added
  • yarn test passes

@cypress
Copy link

cypress bot commented May 25, 2020



Test summary

343 0 1 0


Run details

Project canvas-kit
Status Passed
Commit 5faebce ℹ️
Started May 26, 2020 11:48 PM
Ended May 26, 2020 11:52 PM
Duration 03:59 💡
OS Linux Ubuntu Linux - 18.04
Browser Electron 80

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@lychyi
Copy link
Contributor

lychyi commented May 25, 2020

We will have to add some visual tests against this before merging. Someone on the core team can do that. But I just did a very similar fix so this PR looks like the right direction. We just got to be careful if borders can change width in different states.

@alexandrzavalii
Copy link
Contributor Author

@lychyi I can try adding visual testing myself.
is it by just adding additional "Visual Testing" story?

'&:not([disabled])': {
'&:focus': {
outline: 'none',
...(variant === AvatarVariant.Dark ? focusRing({separation: 2}) : focusRing()),
...focusRing({separation: 2}),
Copy link
Contributor

Choose a reason for hiding this comment

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

Note for posterity: I realized that there are no guarantees of the avatar color regardless of the variant so it doesn't make sense for this to be conditional

[`[data-whatinput='mouse'] &:focus,
[data-whatinput='touch'] &:focus,
[data-whatinput='pointer'] &:focus`]: {
[`[data-whatinput="mouse"] &:focus,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we back out of the formatting changes here and in styled.ts below?

Copy link
Contributor

Choose a reason for hiding this comment

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

These aren't formatting - this was intentional. I ran into issues with the StaticStates wrapper because it the regex was looking for " and not '.

I updated this to be more technically correct (attributes generally use "), and updated the regex in styled to catch either

import {ComponentStatesTable, permutateProps} from '../../../../utils/storybook';
import {Avatar} from '../index';

const IMAGE_URL = 'https://s3-us-west-2.amazonaws.com/design-assets-internal/avatars/lmcneil.png';
Copy link
Contributor

@anicholls anicholls May 26, 2020

Choose a reason for hiding this comment

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

I think this is going to have to be sourced locally: https://www.chromatic.com/snapshot?appId=5d854c26ba934e0020f5e98a&id=5ecc4f8baabec60022686108

Resources requested by the new spec could not be loaded. Snapshots may be affected

@lychyi lychyi added the 4.x label May 26, 2020
@anicholls anicholls added the bug Something isn't working label May 26, 2020
@jpante jpante added this to the v4.0.0 milestone May 26, 2020
@anicholls anicholls merged commit fd475bf into Workday:prerelease/v4 May 27, 2020
This was referenced Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants