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

Bug/accordion long sections faster #121

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

carmen-tang
Copy link
Contributor

No description provided.

HannaLetska
HannaLetska previously approved these changes Dec 18, 2019
Copy link
Contributor

@HannaLetska HannaLetska left a comment

Choose a reason for hiding this comment

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

looks good

const transitionDuration = Math.max(this.accordionContent.current.clientHeight, 300) > 5000
? 5000
const transitionDuration = Math.max(this.accordionContent.current.clientHeight, 300) > 2000
? 1000
Copy link
Contributor

Choose a reason for hiding this comment

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

this logic makes no sense
if it's gonna take longer than 2 seconds, it'll make it 1 second. else everything else can go up to 2.
both numbers should be 2000

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Isn't it if the client height is more than 2000, make it 1 second? Otherwise, make it whatever seconds the height it is? (height of container, 300px = 300ms)

@@ -122,13 +122,17 @@ class Accordion extends Component {
window.requestAnimationFrame(() => {
this.accordionContent.current.parentNode.style.height = 0;

const closeTransitionDuration = Math.max(this.accordionContent.current.clientHeight, 300) > 2000
? 1000
Copy link
Contributor

Choose a reason for hiding this comment

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

this logic makes no sense
if it's gonna take longer than 2 seconds, it'll make it 1 second. else everything else can go up to 2.
both numbers should be 2000

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.

3 participants