Fix mobile navbar bug (#1428)

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
This commit is contained in:
SleeplessOne1917 2023-06-21 00:09:45 +00:00 committed by GitHub
parent cec22203c0
commit bc658a80a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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 (