diff --git a/packages/react/src/components/Tooltip/Tooltip-story.js b/packages/react/src/components/Tooltip/Tooltip-story.js index 365986947235..53984364a1ca 100644 --- a/packages/react/src/components/Tooltip/Tooltip-story.js +++ b/packages/react/src/components/Tooltip/Tooltip-story.js @@ -38,15 +38,13 @@ const props = { triggerText: text('Trigger text (triggerText)', 'Tooltip label'), tabIndex: number('Tab index (tabIndex in )', 0), renderIcon: React.forwardRef((props, ref) => ( -
+
+ + + + + +
)), }), customIconOnly: () => ({ @@ -58,6 +56,13 @@ const props = { }), }; +const containerStyles = { + height: 'calc(100vh - 6rem)', + display: 'flex', + justifyContent: 'center', + alignItems: 'center', +}; + Tooltip.displayName = 'Tooltip'; function UncontrolledTooltipExample() { @@ -91,7 +96,7 @@ storiesOf('Tooltip', module) .add( 'default (bottom)', () => ( -
+

This is some tooltip text. This box shows the maximum amount of text @@ -120,7 +125,7 @@ storiesOf('Tooltip', module) .add( 'no icon', () => ( -

+

This is some tooltip text. This box shows the maximum amount of text @@ -147,9 +152,9 @@ storiesOf('Tooltip', module) } ) .add( - 'custom icon', + 'render custom icon', () => ( -

+

This is some tooltip text. This box shows the maximum amount of text @@ -178,7 +183,7 @@ storiesOf('Tooltip', module) .add( 'only custom icon', () => ( -

+

This is some tooltip text. This box shows the maximum amount of text diff --git a/packages/react/src/internal/FloatingMenu.js b/packages/react/src/internal/FloatingMenu.js index 01e0ba3071c9..2e71a9ab5be2 100644 --- a/packages/react/src/internal/FloatingMenu.js +++ b/packages/react/src/internal/FloatingMenu.js @@ -94,7 +94,7 @@ const getFloatingPosition = ({ return { [DIRECTION_LEFT]: () => ({ left: refLeft - width + scrollX - left, - top: refCenterVertical - height / 2 + scrollY + top, + top: refCenterVertical - height / 2 + scrollY + top - 9, }), [DIRECTION_TOP]: () => ({ left: refCenterHorizontal - width / 2 + scrollX + left, @@ -102,7 +102,7 @@ const getFloatingPosition = ({ }), [DIRECTION_RIGHT]: () => ({ left: refRight + scrollX + left, - top: refCenterVertical - height / 2 + scrollY + top, + top: refCenterVertical - height / 2 + scrollY + top + 3, }), [DIRECTION_BOTTOM]: () => ({ left: refCenterHorizontal - width / 2 + scrollX + left,