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