fix(v2): do not set height for mobile dropdown (#3647)

This commit is contained in:
Alexey Pyltsyn 2020-10-28 19:52:44 +03:00 committed by GitHub
parent 9f66545c8c
commit f085560b66
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -179,6 +179,10 @@ function NavItemMobile({
);
}
const menuListHeight = menuListRef.current?.scrollHeight
? `${menuListRef.current?.scrollHeight}px`
: undefined;
return (
<li
className={clsx('menu__list-item', {
@ -197,9 +201,7 @@ function NavItemMobile({
className="menu__list"
ref={menuListRef}
style={{
height: !collapsed
? `${menuListRef.current?.scrollHeight}px`
: undefined,
height: !collapsed ? menuListHeight : undefined,
}}>
{items.map(({className: childItemClassName, ...childItemProps}, i) => (
<li className="menu__list-item" key={i}>