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(chips): Add delay to filter chip checkmark #2804

Merged
merged 9 commits into from
May 29, 2018

Conversation

EstebanG23
Copy link
Contributor

@EstebanG23 EstebanG23 commented May 24, 2018

Fixes #2384

Add delay to transition animation so checkmark does not appear behind text. Add speed up to leading icon to brige gap between icons.

Add delay to transition animation so checkmark does not appear behind text. Add speed up to leading icon to brige gap between icons.
Copy link
Contributor

@bonniezhou bonniezhou left a comment

Choose a reason for hiding this comment

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

Nice! LGTM but I'm gonna add another reviewer just to double check

@@ -118,10 +118,12 @@
.mdc-chip__icon--leading {
transition: opacity $mdc-chip-opacity-animation-duration linear;
opacity: 1;
transition-delay: -50ms;
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a comment here to explain what's this line is for

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@codecov-io
Copy link

codecov-io commented May 24, 2018

Codecov Report

Merging #2804 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2804   +/-   ##
=======================================
  Coverage   98.42%   98.42%           
=======================================
  Files          98       98           
  Lines        4203     4203           
  Branches      534      534           
=======================================
  Hits         4137     4137           
  Misses         66       66

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2f13286...6e876f8. Read the comment docs.

@@ -117,10 +117,16 @@

.mdc-chip__icon--leading {
transition: opacity $mdc-chip-opacity-animation-duration linear;

// Speed up delay to bridge gap between leading icon and checkmark transition.
transition-delay: -50ms;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this negative?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

By delaying the transition of the checkmark it also delayed the appearance of the leading icon, and so I used the transition-delay feature to actually speed it up to bridge the gap from checkmark fading out and leading icon fading in. Helps the transition feel/look more natural.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah my bad! I thought this was the transition-duration.

Since these numbers are important, I'd move them to the _variables.scss file.

Once that's in, I'll LGTM it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@@ -28,6 +28,8 @@ $mdc-chip-trailing-icon-hover-opacity: .62;
$mdc-chip-trailing-icon-focus-opacity: .87;
$mdc-chip-leading-icon-size: 20px;
$mdc-chip-trailing-icon-size: 18px;
$mdc-chip-leading-icon-speedup: -50ms;
Copy link
Contributor

Choose a reason for hiding this comment

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

Change this name to $mdc-chip-leading-icon-delay and move the comment about why it's negative to this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@patrickrodee patrickrodee merged commit 9e35b1e into master May 29, 2018
@kfranqueiro kfranqueiro deleted the chip/filter/checkmark branch August 1, 2018 16:21
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.

None yet

4 participants