fix(explore): Filters Tooltip is not showing the full content (#14618)

* Add getTooltipTitle

* Fix tests
This commit is contained in:
Geido
2021-05-13 20:03:22 +03:00
committed by GitHub
parent 568061e8d4
commit 1e601483e3
4 changed files with 9 additions and 1 deletions

View File

@@ -36,6 +36,7 @@ import {
const defaultProps = {
label: <span>Test label</span>,
tooltipTitle: 'This is a tooltip title',
onRemove: jest.fn(),
onMoveLabel: jest.fn(),
onDropLabel: jest.fn(),

View File

@@ -167,6 +167,7 @@ export const OptionControlLabel = ({
type,
index,
isExtra,
tooltipTitle,
...props
}: {
label: string | React.ReactNode;
@@ -181,6 +182,7 @@ export const OptionControlLabel = ({
type: string;
index: number;
isExtra?: boolean;
tooltipTitle: string;
}) => {
const theme = useTheme();
const ref = useRef<HTMLDivElement>(null);
@@ -246,7 +248,7 @@ export const OptionControlLabel = ({
if (savedMetric?.metric_name) {
return <StyledMetricOption metric={savedMetric} />;
}
return <Tooltip title={label}>{label}</Tooltip>;
return <Tooltip title={tooltipTitle}>{label}</Tooltip>;
};
const getOptionControlContent = () => (