mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-18 19:46:57 +02:00
fix(v2): do not set height for mobile dropdown (#3647)
This commit is contained in:
parent
9f66545c8c
commit
f085560b66
1 changed files with 5 additions and 3 deletions
|
@ -179,6 +179,10 @@ function NavItemMobile({
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const menuListHeight = menuListRef.current?.scrollHeight
|
||||||
|
? `${menuListRef.current?.scrollHeight}px`
|
||||||
|
: undefined;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li
|
<li
|
||||||
className={clsx('menu__list-item', {
|
className={clsx('menu__list-item', {
|
||||||
|
@ -197,9 +201,7 @@ function NavItemMobile({
|
||||||
className="menu__list"
|
className="menu__list"
|
||||||
ref={menuListRef}
|
ref={menuListRef}
|
||||||
style={{
|
style={{
|
||||||
height: !collapsed
|
height: !collapsed ? menuListHeight : undefined,
|
||||||
? `${menuListRef.current?.scrollHeight}px`
|
|
||||||
: undefined,
|
|
||||||
}}>
|
}}>
|
||||||
{items.map(({className: childItemClassName, ...childItemProps}, i) => (
|
{items.map(({className: childItemClassName, ...childItemProps}, i) => (
|
||||||
<li className="menu__list-item" key={i}>
|
<li className="menu__list-item" key={i}>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue