Skip to content

Commit e3b7999

Browse files
authored
fix(Disclosure): transitionDuration prop logic (#1061)
1 parent 7c5a793 commit e3b7999

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cube-dev/ui-kit": patch
3+
---
4+
5+
Fix Disclosure: pass `transitionDuration` as `$disclosure-transition` token so the height animation uses the same duration as the expand/collapse transition

src/components/content/Disclosure/Disclosure.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,11 @@ const DisclosureContent = forwardRef<
417417
<ContentWrapperElement
418418
ref={transitionRef}
419419
mods={{ shown: isShown, phase }}
420+
tokens={
421+
transitionDuration != null
422+
? { '$disclosure-transition': `${transitionDuration}ms` }
423+
: undefined
424+
}
420425
>
421426
<ContentElement
422427
ref={mergeRefs(ref, panelRef)}

0 commit comments

Comments
 (0)