mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-01-17 04:52:10 +01:00
Fix navbar event listener
This commit is contained in:
2
gradle/changelog/navbar_events.yaml
Normal file
2
gradle/changelog/navbar_events.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
- type: fixed
|
||||
description: Window event listener on navbar
|
||||
@@ -22,7 +22,7 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
import React, {FC, useEffect, useRef, useState} from "react";
|
||||
import React, { FC, useEffect, useRef, useState } from "react";
|
||||
import { Links } from "@scm-manager/ui-types";
|
||||
import classNames from "classnames";
|
||||
import styled from "styled-components";
|
||||
@@ -107,8 +107,13 @@ const NavigationBar: FC<Props> = ({ links }) => {
|
||||
const [t] = useTranslation("commons");
|
||||
const notificationsRef = useRef<HTMLButtonElement>(null);
|
||||
useEffect(() => {
|
||||
const close = () => {
|
||||
if (burgerActive) {
|
||||
const close = (event: MouseEvent) => {
|
||||
const classList = event.target.classList.value;
|
||||
if (
|
||||
!classList.includes("navbar-burger") &&
|
||||
!classList.includes("navbar-brand") &&
|
||||
!classList.includes("search-box")
|
||||
) {
|
||||
setBurgerActive(false);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -205,7 +205,7 @@ const OmniSearch: FC<Props> = ({ shouldClear }) => {
|
||||
})}
|
||||
>
|
||||
<SearchBox query={query} onQueryChange={setQuery} shouldClear={shouldClear}>
|
||||
<SearchBox.Input className="is-small" placeholder={t("search.placeholder")} ref={searchInputRef} />
|
||||
<SearchBox.Input className="is-small search-box" placeholder={t("search.placeholder")} ref={searchInputRef} />
|
||||
<SearchBox.Options>{entries}</SearchBox.Options>
|
||||
</SearchBox>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user