Skip to content

Commit

Permalink
fix: Navbar2 bugs (#490)
Browse files Browse the repository at this point in the history
* fix: submenu and not clickable

* fix: not scrollable

* fix: suggestions

* fix: prettier
  • Loading branch information
lauti7 authored Jan 11, 2024
1 parent e033fc6 commit 3ff706d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/components/Navbar2/Navbar2.css
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,10 @@
.dui-navbar2 .item.submenu .submenu-column__wrapper {
flex-flow: row wrap;
}

.dui-navbar2 .item.submenu::after {
content: none;
}
}

@media (max-width: 1199px) {
Expand Down Expand Up @@ -576,4 +580,8 @@
.dui-navbar2.dui-navbar2__mobile-open .item.submenu .dui-submenu-item p {
color: var(--navbar-menu-hover);
}

.dui-navbar2 .item.submenu {
position: fixed;
}
}
11 changes: 10 additions & 1 deletion src/components/Navbar2/Navbar2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ export const Navbar2 = React.memo((props: Navbar2Props) => {

const handleMobileToggle = useCallback(
(e: React.MouseEvent, show: boolean) => {
!show && setToggle(false)
if (!show) {
setToggle(false)
window.removeEventListener('scroll', noScroll)
} else {
window.addEventListener('scroll', noScroll)
}
setMenuMobileOpen(show)
},
[setToggle, setMenuMobileOpen]
Expand Down Expand Up @@ -129,3 +134,7 @@ export const Navbar2 = React.memo((props: Navbar2Props) => {
</div>
)
})

function noScroll() {
window.scrollTo(0, 0)
}

1 comment on commit 3ff706d

@vercel
Copy link

@vercel vercel bot commented on 3ff706d Jan 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

decentraland-ui – ./

decentraland-ui-decentraland1.vercel.app
decentraland-ui-git-master-decentraland1.vercel.app

Please sign in to comment.