]> Untitled Git - lemmy-ui.git/commitdiff
Fix mobile navbar bug (#1428)
authorSleeplessOne1917 <abias1122@gmail.com>
Wed, 21 Jun 2023 00:09:45 +0000 (00:09 +0000)
committerGitHub <noreply@github.com>
Wed, 21 Jun 2023 00:09:45 +0000 (20:09 -0400)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
src/shared/components/app/navbar.tsx

index 0163f60318e9f3fb047446dd67981a36d8a5bb6b..5fa7580c798d674350859b21eff8ad37e96b8544 100644 (file)
@@ -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<NavbarProps, NavbarState> {
     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 (