-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
src/elements/Accordion/Accordion.js
Outdated
const transitionDuration = Math.max(this.accordionContent.current.clientHeight, 300) > 5000 | ||
? 5000 | ||
const transitionDuration = Math.max(this.accordionContent.current.clientHeight, 300) > 2000 | ||
? 1000 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)
src/elements/Accordion/Accordion.js
Outdated
@@ -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 |
There was a problem hiding this comment.
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
No description provided.