Skip to content

Conversation

@artygus
Copy link
Contributor

@artygus artygus commented Aug 16, 2019

WHY are these changes introduced?

Fixes #1133

I believe the issue is caused by collapsing margins. Height of element with overflow: hidden includes margins of children, while margins of children of overflow: visible element spills through the parent and are not included in parent's height.

WHAT is this pull request doing?

  • changes collapsible animation property from height to max-height

@ghost
Copy link

ghost commented Aug 16, 2019

👋 Thanks for opening your first pull request. A contributor should give feedback soon. If you haven’t already, please check out the contributing guidelines.

@ghost ghost added the cla-needed Added by a bot. Contributor needs to sign the CLA Agreement. label Aug 16, 2019
@artygus artygus force-pushed the fix-collapsible-animation-jank branch from 6b84e00 to 2eb7e32 Compare August 16, 2019 17:42
@ghost ghost removed the cla-needed Added by a bot. Contributor needs to sign the CLA Agreement. label Aug 16, 2019
@artygus artygus force-pushed the fix-collapsible-animation-jank branch from 1658bfa to 9b653a5 Compare August 16, 2019 19:23
@artygus
Copy link
Contributor Author

artygus commented Aug 16, 2019

another solution might be adding same overflow properties to height container

@artygus artygus force-pushed the fix-collapsible-animation-jank branch from 3686ec9 to 2db23a3 Compare August 16, 2019 19:25
@artygus artygus force-pushed the fix-collapsible-animation-jank branch from 2db23a3 to e93dc4a Compare August 16, 2019 21:38
@danrosenthal
Copy link

Hey @artygus, thanks for the contribution. Would you be able to add some tests for this change?

@artygus
Copy link
Contributor Author

artygus commented Sep 25, 2019

@danrosenthal sure, it it'll help to get it merged

@danrosenthal
Copy link

danrosenthal commented Sep 25, 2019

sure, it it'll help to get it merged

It'll definitely be a good start! And sorry for the delay on getting you review.

@danrosenthal danrosenthal requested a review from ry5n September 25, 2019 15:11
@danrosenthal
Copy link

@ry5n, since you created the issue this addresses, would you be able to give this a tophat?

You can tophat it locally by running:

$ git fetch origin pull/1980/head:tophat-1980 && git checkout tophat-1980

@danrosenthal
Copy link

My 🎩 looks pretty good. Frame-rate is mostly around 60fps, and the jank appears to be significantly reduced. This'll likely not be perfectly smooth until we reimplement it using a CSS property that creates its own layer and uses hardware acceleration (a property like transform).

@ry5n
Copy link
Contributor

ry5n commented Sep 25, 2019

I may not be able to take a look today but I’ll do my best. If you feel satisfied this is better please go ahead and merge.

@artygus artygus force-pushed the fix-collapsible-animation-jank branch from e93dc4a to 5665556 Compare October 10, 2019 18:23
@sarahill sarahill self-requested a review October 17, 2019 19:11
Copy link
Contributor

@sarahill sarahill left a comment

Choose a reason for hiding this comment

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

This looks good to me. Much smoother! Definitely an improvement. @danrosenthal or @kaelig can you give this another once over so we can get this in?

@artygus
Copy link
Contributor Author

artygus commented Oct 17, 2019

I'm stuck with tests, couldn't find a good example on how to test animations. Any references to good examples would certainly help 🙂

Copy link

@danrosenthal danrosenthal left a comment

Choose a reason for hiding this comment

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

Looking deeper at the changes, I think this one is going to be tricky (impossible) to test. Go ahead and rebase your PR to fix the UNRELEASED conflict, and @sarahill or someone else on the team can merge it for you.

height might be miscalculated due to collapsing margins
@artygus artygus force-pushed the fix-collapsible-animation-jank branch from 5665556 to 481096a Compare October 18, 2019 14:35
@artygus
Copy link
Contributor Author

artygus commented Oct 18, 2019

cool, rebased!

@danrosenthal danrosenthal merged commit 82e068c into Shopify:master Oct 18, 2019
@ghost
Copy link

ghost commented Oct 18, 2019

🎉 Thanks for your contribution to Polaris React!

@LauraAubin LauraAubin temporarily deployed to production October 22, 2019 17:39 Inactive
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.

[Collapsible] Accordion animation not smooth

6 participants