mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-10 23:02:56 +02:00
fix: proper collapsing of long element (#5694)
* fix: proper collapsing of long element * Add example * Reorder * Another solution with overflow * Restore original solution
This commit is contained in:
parent
e22170408a
commit
1361a5a38e
2 changed files with 14 additions and 18 deletions
|
@ -197,21 +197,8 @@ function CollapsibleBase({
|
|||
return;
|
||||
}
|
||||
|
||||
const el = collapsibleRef.current!;
|
||||
const currentCollapsibleElementHeight = el.style.height;
|
||||
|
||||
if (
|
||||
!collapsed &&
|
||||
parseInt(currentCollapsibleElementHeight, 10) === el.scrollHeight
|
||||
) {
|
||||
applyCollapsedStyle(el, false);
|
||||
onCollapseTransitionEnd?.(false);
|
||||
}
|
||||
|
||||
if (currentCollapsibleElementHeight === CollapsedStyles.height) {
|
||||
applyCollapsedStyle(el, true);
|
||||
onCollapseTransitionEnd?.(true);
|
||||
}
|
||||
applyCollapsedStyle(collapsibleRef.current!, collapsed);
|
||||
onCollapseTransitionEnd?.(collapsed);
|
||||
}}
|
||||
className={className}>
|
||||
{children}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue