From: SleeplessOne1917 Date: Wed, 21 Jun 2023 00:09:45 +0000 (+0000) Subject: Fix mobile navbar bug (#1428) X-Git-Url: http://these/git/%7BtotpUrl%7D?a=commitdiff_plain;h=bc658a80a442eb723cd44e425d61236f789bf4e4;p=lemmy-ui.git Fix mobile navbar bug (#1428) Co-authored-by: Dessalines --- diff --git a/src/shared/components/app/navbar.tsx b/src/shared/components/app/navbar.tsx index 0163f60..5fa7580 100644 --- a/src/shared/components/app/navbar.tsx +++ b/src/shared/components/app/navbar.tsx @@ -35,7 +35,11 @@ interface NavbarState { } function handleCollapseClick(i: Navbar) { - if (i.collapseButtonRef.current?.ariaExpanded === "true") { + if ( + i.collapseButtonRef.current?.attributes && + i.collapseButtonRef.current?.attributes.getNamedItem("aria-expanded") + ?.value === "true" + ) { i.collapseButtonRef.current?.click(); } } @@ -76,12 +80,8 @@ export class Navbar extends Component { document.removeEventListener("mouseup", this.handleOutsideMenuClick); } + // TODO class active corresponding to current pages render() { - return this.navbar(); - } - - // TODO class active corresponding to current page - navbar() { const siteView = this.props.siteRes?.site_view; const person = UserService.Instance.myUserInfo?.local_user_view.person; return (