Fix dropdown bug
This commit is contained in:
parent
7471dc140e
commit
c6a6c99efe
1 changed files with 5 additions and 3 deletions
|
@ -34,8 +34,10 @@ interface NavbarState {
|
|||
}
|
||||
|
||||
function handleCollapseClick(i: Navbar) {
|
||||
if (i.collapseButtonRef.current?.ariaExpanded === "true") {
|
||||
i.collapseButtonRef.current?.click();
|
||||
}
|
||||
}
|
||||
|
||||
function handleLogOut(i: Navbar) {
|
||||
UserService.Instance.logout();
|
||||
|
@ -65,12 +67,12 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
|
|||
await this.fetchUnreads();
|
||||
this.requestNotificationPermission();
|
||||
|
||||
document.addEventListener("click", this.handleOutsideMenuClick);
|
||||
document.addEventListener("mouseup", this.handleOutsideMenuClick);
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
document.removeEventListener("click", this.handleOutsideMenuClick);
|
||||
document.removeEventListener("mouseup", this.handleOutsideMenuClick);
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
Loading…
Reference in a new issue