Fix jumping and broken tool tips (#2026)

The way the tool tip implements passed class names is mistakable. The passed classes broke the tool tip and are removed. The same issue led to a broken tool tip for the code search and is fixed as well. Unnecessary code is removed from help.

Fixes #2025
This commit is contained in:
Phil-Ah
2022-05-05 21:51:20 +02:00
committed by GitHub
parent a5d1901660
commit 6cf8afac01
4 changed files with 10 additions and 13 deletions

View File

@@ -0,0 +1,2 @@
- type: fixed
description: Fix jumping and broken tool tips ([#2026](https://github.com/scm-manager/scm-manager/pull/2026))

View File

@@ -23,7 +23,6 @@
*/ */
import React, { FC } from "react"; import React, { FC } from "react";
import classNames from "classnames"; import classNames from "classnames";
import styled from "styled-components";
import Tooltip from "./Tooltip"; import Tooltip from "./Tooltip";
import HelpIcon from "./HelpIcon"; import HelpIcon from "./HelpIcon";
@@ -34,19 +33,15 @@ type Props = {
id?: string; id?: string;
}; };
const AbsolutePositionTooltip = styled(Tooltip)`
position: absolute;
`;
const Help: FC<Props> = ({ message, multiline, className, id }) => ( const Help: FC<Props> = ({ message, multiline, className, id }) => (
<AbsolutePositionTooltip <Tooltip
className={classNames("is-inline-block", "pl-1", className)} className={classNames("is-inline-block", "pl-1", className)}
message={message} message={message}
id={id} id={id}
multiline={multiline} multiline={multiline}
> >
<HelpIcon /> <HelpIcon />
</AbsolutePositionTooltip> </Tooltip>
); );
Help.defaultProps = { Help.defaultProps = {

View File

@@ -37,17 +37,17 @@ export default class TagGroup extends React.Component<Props> {
const { items, label, helpText } = this.props; const { items, label, helpText } = this.props;
let help = null; let help = null;
if (helpText) { if (helpText) {
help = <Help className="is-relative" message={helpText} />; help = <Help message={helpText} />;
} }
return ( return (
<div className="field is-grouped is-grouped-multiline"> <div className="field is-grouped is-grouped-multiline">
{label && items ? ( {label && items ? (
<div className="control"> <div className="control">
<strong> <label className="label">
{label} <span>{label} </span>
{help} {help}
{items.length > 0 ? ":" : ""} {items.length > 0 ? ":" : ""}
</strong> </label>
</div> </div>
) : ( ) : (
"" ""

View File

@@ -117,7 +117,7 @@ const FileSearch: FC<Props> = ({ repository, baseUrl, branches, selectedBranch }
<HomeIcon title={t("fileSearch.home")} name="home" color="inherit" /> <HomeIcon title={t("fileSearch.home")} name="home" color="inherit" />
</HomeLink> </HomeLink>
<FilterInput <FilterInput
className="is-full-width" className="is-full-width pr-2"
placeholder={t("fileSearch.input.placeholder")} placeholder={t("fileSearch.input.placeholder")}
value={query} value={query}
filter={search} filter={search}
@@ -125,7 +125,7 @@ const FileSearch: FC<Props> = ({ repository, baseUrl, branches, selectedBranch }
id={id} id={id}
testId="file_search_filter_input" testId="file_search_filter_input"
/> />
<Help className="ml-3" message={t("fileSearch.input.help")} id={id} /> <Help message={t("fileSearch.input.help")} id={id} />
</div> </div>
<ErrorNotification error={error} /> <ErrorNotification error={error} />
{isLoading ? <Loading /> : <FileSearchResults contentBaseUrl={contentBaseUrl} query={query} paths={result} />} {isLoading ? <Loading /> : <FileSearchResults contentBaseUrl={contentBaseUrl} query={query} paths={result} />}