diff --git a/.changeset/smart-oranges-peel.md b/.changeset/smart-oranges-peel.md new file mode 100644 index 0000000000..90aab7f5e4 --- /dev/null +++ b/.changeset/smart-oranges-peel.md @@ -0,0 +1,6 @@ +--- +"@nextui-org/navbar": patch +--- + + +Resolving the issue preventing the navbar from opening(#4345) diff --git a/packages/components/navbar/src/use-navbar.ts b/packages/components/navbar/src/use-navbar.ts index 3e245c15a4..65aed83076 100644 --- a/packages/components/navbar/src/use-navbar.ts +++ b/packages/components/navbar/src/use-navbar.ts @@ -161,6 +161,11 @@ export function useNavbar(originalProps: UseNavbarProps) { ref: domRef, onResize: () => { const currentWidth = domRef.current?.offsetWidth; + const scrollWidth = window.innerWidth - document.documentElement.clientWidth; + + if (currentWidth && currentWidth + scrollWidth == prevWidth.current) { + return; + } if (currentWidth !== prevWidth.current) { updateWidth();