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(collapsible-motion): do not set to null on rerender #1043

Merged
merged 1 commit into from
Sep 3, 2019
Merged

Conversation

montezume
Copy link
Contributor

@montezume montezume commented Sep 3, 2019

Summary

Fix for the CollapsibleMotion component. Currently if the component is rerendered without the isOpen prop changing, the animation is lost. Leading to bugs

@@ -65,16 +66,14 @@ const useToggleAnimation = (isOpen, toggle, minHeight) => {
? { height: 'auto' }
: { height: getMinHeight(minHeight), overflow: 'hidden' };

let animation = null;

// if state has changed
if (typeof prevIsOpen !== 'undefined' && prevIsOpen !== isOpen) {
Copy link
Contributor Author

@montezume montezume Sep 3, 2019

Choose a reason for hiding this comment

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

before if the component re-rendered without a toggle, animation was reset to null. Now the animation stays. The animation should be null for the FIRST toggle, and then after that it should remain without being reset to null

@montezume montezume requested a review from tdeekens September 3, 2019 13:00
@montezume montezume self-assigned this Sep 3, 2019
@montezume montezume added the 🐛 Type: Bug Something isn't working label Sep 3, 2019
@kodiakhq kodiakhq bot merged commit bc91861 into master Sep 3, 2019
@kodiakhq kodiakhq bot deleted the ml-col branch September 3, 2019 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants