Skip to content

Conversation

@Kneemund
Copy link

@Kneemund Kneemund commented Jan 9, 2026

This PR adds an early return to the slideDown function that skips the animation if the duration is set to zero.


Currently, when the duration is zero, the second timeout runs BEFORE the first one (at least on Firefox), and doesn't properly clear the style attributes:

globalThis.setTimeout(() => {
target.style.boxSizing = 'border-box'
target.style.transitionProperty = 'height, margin, padding'
target.style.transitionDuration = `${duration}ms`
target.style.height = `${height}px`
target.style.removeProperty('padding-top')
target.style.removeProperty('padding-bottom')
target.style.removeProperty('margin-top')
target.style.removeProperty('margin-bottom')
}, 1)
globalThis.setTimeout(() => {
target.style.removeProperty('height')
target.style.removeProperty('overflow')
target.style.removeProperty('transition-duration')
target.style.removeProperty('transition-property')
}, duration)


This fixes a bug in the sidebar treeview, where this function is used with a duration of zero to instantly open entries when the page loads:

slideDown(childElement, 0)

As an alternative fix, the duration parameter could be clamped to be greater than 1.

@netlify
Copy link

netlify bot commented Jan 9, 2026

Deploy Preview for adminlte-v4 ready!

Name Link
🔨 Latest commit 702a0ea
🔍 Latest deploy log https://app.netlify.com/projects/adminlte-v4/deploys/69617f641dc31d00087344e7
😎 Deploy Preview https://deploy-preview-5964--adminlte-v4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

1 participant