Skip to content

Commit

Permalink
fix: navbar state change (#4406)
Browse files Browse the repository at this point in the history
  • Loading branch information
macci001 authored Dec 22, 2024
1 parent b5943db commit de0e277
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/smart-oranges-peel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@nextui-org/navbar": patch
---


Resolving the issue preventing the navbar from opening(#4345)
5 changes: 5 additions & 0 deletions packages/components/navbar/src/use-navbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit de0e277

Please sign in to comment.