mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
fix(navbar): allow height prop to accept number type and fix broken menu (#3601)
* fix(navbar): allow height prop to accept number type and fix broken menu * fix(navbar): menu breaking when a numerical height value is provided. changeset
This commit is contained in:
parent
3c0a486cea
commit
048de6e9b2
5
.changeset/healthy-clouds-refuse.md
Normal file
5
.changeset/healthy-clouds-refuse.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"@nextui-org/navbar": patch
|
||||
---
|
||||
|
||||
Fix navbar menu breaking when a numerical height value is provided. The height value is now converted to pixels if it is a number.
|
||||
@ -50,7 +50,7 @@ const NavbarMenu = forwardRef<"ul", NavbarMenuProps>((props, ref) => {
|
||||
data-open={dataAttr(isMenuOpen)}
|
||||
style={{
|
||||
// @ts-expect-error
|
||||
"--navbar-height": height,
|
||||
"--navbar-height": typeof height === "number" ? `${height}px` : height,
|
||||
}}
|
||||
{...otherProps}
|
||||
>
|
||||
@ -72,7 +72,7 @@ const NavbarMenu = forwardRef<"ul", NavbarMenuProps>((props, ref) => {
|
||||
initial="exit"
|
||||
style={{
|
||||
// @ts-expect-error
|
||||
"--navbar-height": height,
|
||||
"--navbar-height": typeof height === "number" ? `${height}px` : height,
|
||||
...style,
|
||||
}}
|
||||
variants={menuVariants}
|
||||
|
||||
@ -198,7 +198,7 @@ export function useNavbar(originalProps: UseNavbarProps) {
|
||||
ref: domRef,
|
||||
className: slots.base({class: clsx(baseStyles, props?.className)}),
|
||||
style: {
|
||||
"--navbar-height": height,
|
||||
"--navbar-height": typeof height === "number" ? `${height}px` : height,
|
||||
...otherProps?.style,
|
||||
...props?.style,
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user