diff --git a/packages/core/src/components/Tooltip/index.tsx b/packages/core/src/components/Tooltip/index.tsx index cd8bcca84..10fcf6cd0 100644 --- a/packages/core/src/components/Tooltip/index.tsx +++ b/packages/core/src/components/Tooltip/index.tsx @@ -28,7 +28,7 @@ export type TooltipProps = { content: NonNullable; /** True to disable tooltip but still show children. */ disabled?: boolean; - /** Manually override calculated horizontal align */ + /** Manually override calculated horizontal align. */ horizontalAlign?: 'center' | 'left' | 'right'; /** True to use a light background with dark text. */ inverted?: boolean; @@ -36,7 +36,7 @@ export type TooltipProps = { onClose?: () => void; /** Callback fired when the tooltip is shown. */ onShow?: () => void; - /** True to enable interactive popover functionality */ + /** True to enable interactive popover functionality. */ popover?: boolean; /** True to prevent dismissmal on mouse down. */ remainOnMouseDown?: boolean; @@ -44,7 +44,7 @@ export type TooltipProps = { toggleOnClick?: boolean; /** True to add a dotted bottom border. */ underlined?: boolean; - /** Manually override calculated vertical align */ + /** Manually override calculated vertical align. */ verticalAlign?: 'above' | 'below'; /** Width of the tooltip in units. */ width?: number; @@ -314,23 +314,17 @@ export class Tooltip extends React.Component -
+
{content}
); - if (popover) { - return open &&
{popupContent}
; - } - return ( - + {popupContent} ); diff --git a/packages/core/src/components/Tooltip/story.tsx b/packages/core/src/components/Tooltip/story.tsx index a71b581ff..611fbdf0b 100644 --- a/packages/core/src/components/Tooltip/story.tsx +++ b/packages/core/src/components/Tooltip/story.tsx @@ -2,6 +2,8 @@ import React from 'react'; import LoremIpsum from ':storybook/components/LoremIpsum'; import { withexpandMultiple } from '../Accordion/story'; import Button from '../Button'; +import DataTable from '../DataTable'; +import { RendererProps } from '../DataTable/types'; import Text from '../Text'; import Spacing from '../Spacing'; import Link from '../Link'; @@ -389,3 +391,52 @@ export function popoverExpandsAndShrinksWithContent() { popoverExpandsAndShrinksWithContent.story = { name: 'Popover expands and shrinks with content.', }; + +export function popoverEscapesDataTableRow() { + return ( + ) => { + const { name } = row.rowData.data; + + return ( + + Certified by {name} +
+ +
+ + Click me! + + + } + > + {name} +
+ ); + }, + }} + /> + ); +} + +popoverEscapesDataTableRow.story = { + name: 'Popover can escape a DataTable row.', +}; diff --git a/packages/core/src/components/Tooltip/styles.ts b/packages/core/src/components/Tooltip/styles.ts index 9ca9b9f48..5c3155e5a 100644 --- a/packages/core/src/components/Tooltip/styles.ts +++ b/packages/core/src/components/Tooltip/styles.ts @@ -58,9 +58,4 @@ export const styleSheetTooltip: StyleSheet = ({ unit, color, pattern, ui }) => ( color: color.base, backgroundColor: color.baseInverse, }, - - popover: { - position: 'absolute', - zIndex: 1, - }, });