diff --git a/src/App.tsx b/src/App.tsx index b71a4947..fd85b9ad 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,7 +2,7 @@ /* eslint-disable jsx-a11y/click-events-have-key-events */ import { TooltipController as Tooltip } from 'components/TooltipController' import { IPosition } from 'components/Tooltip/TooltipTypes.d' -import React, { useMemo, useState } from 'react' +import React, { useState } from 'react' import { inline, offset } from '@floating-ui/dom' import styles from './styles.module.css' @@ -23,26 +23,6 @@ function App() { setAnchorId(target.id) } - const [which, setWhich] = useState<'1' | '2'>('1') - const [show, setShow] = useState(true) - - const button1 = useMemo( - () => ( - - ), - [], - ) - const button2 = useMemo( - () => ( - - ), - [], - ) - return (
-
void) = null if (closeOnResize) { window.addEventListener('resize', handleScrollResize) - } else if (activeAnchor && tooltipRef.current && !holdPositionOnRender) { + } else if (activeAnchor && tooltipRef.current) { updateTooltipCleanup = autoUpdate( activeAnchor as HTMLElement, tooltipRef.current as HTMLElement, @@ -640,7 +639,7 @@ const Tooltip = ({ const canShow = !hidden && content && show && Object.keys(inlineStyles).length > 0 - return rendered || (wasShowing.current && holdPositionOnRender) ? ( + return rendered ? ( void afterShow?: () => void afterHide?: () => void diff --git a/src/components/TooltipController/TooltipController.tsx b/src/components/TooltipController/TooltipController.tsx index 773328e5..729e77b8 100644 --- a/src/components/TooltipController/TooltipController.tsx +++ b/src/components/TooltipController/TooltipController.tsx @@ -45,7 +45,6 @@ const TooltipController = ({ position, isOpen, disableStyleInjection = false, - holdPositionOnRender, border, opacity, arrowColor, @@ -334,7 +333,6 @@ const TooltipController = ({ style, position, isOpen, - holdPositionOnRender, border, opacity, arrowColor, diff --git a/src/components/TooltipController/TooltipControllerTypes.d.ts b/src/components/TooltipController/TooltipControllerTypes.d.ts index dd5bf148..e0568907 100644 --- a/src/components/TooltipController/TooltipControllerTypes.d.ts +++ b/src/components/TooltipController/TooltipControllerTypes.d.ts @@ -61,7 +61,6 @@ export interface ITooltipController { position?: IPosition isOpen?: boolean disableStyleInjection?: boolean | 'core' - holdPositionOnRender?: boolean /** * @description see https://developer.mozilla.org/en-US/docs/Web/CSS/border. *