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

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

View File

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