Fix tooltip placement bugs by upgrading Popper

This commit is contained in:
Evan Hahn 2021-08-03 12:04:49 -05:00 committed by GitHub
parent 26b7652492
commit 3b476fb60d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 85 additions and 136 deletions

View file

@ -7,6 +7,7 @@ import { noop } from 'lodash';
import { Manager, Reference, Popper } from 'react-popper';
import { Theme, themeClassName } from '../util/theme';
import { multiRef } from '../util/multiRef';
import { offsetDistanceModifier } from '../util/popperUtil';
type EventWrapperPropsType = {
children: React.ReactNode;
@ -96,7 +97,7 @@ export const Tooltip: React.FC<PropsType> = ({
</TooltipEventWrapper>
)}
</Reference>
<Popper placement={direction}>
<Popper placement={direction} modifiers={[offsetDistanceModifier(12)]}>
{({ arrowProps, placement, ref, style }) =>
showTooltip && (
<div