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 ( 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}>