Skip to content

Commit

Permalink
test delay animation
Browse files Browse the repository at this point in the history
  • Loading branch information
broccolinisoup committed Feb 29, 2024
1 parent d9ffbe8 commit ab17b4a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/react/src/TooltipV2/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const animationStyles = `
animation-duration: 0.1s;
animation-fill-mode: forwards;
animation-timing-function: ease-in;
animation-delay: 0s;
animation-delay: 1s;
`

const StyledTooltip = styled.div`
Expand Down Expand Up @@ -198,6 +198,7 @@ export const Tooltip = React.forwardRef(
const openTooltip = () => {
if (tooltipElRef.current && triggerRef.current && !tooltipElRef.current.matches(':popover-open')) {
tooltipElRef.current.showPopover()
console.log('popover open', tooltipElRef.current.matches(':popover-open'))

Check failure on line 201 in packages/react/src/TooltipV2/Tooltip.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement
}
}
const closeTooltip = () => {
Expand Down Expand Up @@ -252,13 +253,11 @@ export const Tooltip = React.forwardRef(
}

const positionSet = () => {
console.log('top', tooltip.style.top)
console.log('left', tooltip.style.left)

const {top, left, anchorAlign, anchorSide} = getAnchoredPosition(tooltip, trigger, settings)

tooltip.style.top = `${top}px`
tooltip.style.left = `${left}px`
console.log('positionSet')

Check failure on line 260 in packages/react/src/TooltipV2/Tooltip.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement
// This is required to make sure the popover is positioned correctly i.e. when there is not enough space on the specified direction, we set a new direction to position the ::after
const calculatedDirection = positionToDirection[`${anchorSide}-${anchorAlign}` as string]
setCalculatedDirection(calculatedDirection)
Expand All @@ -267,8 +266,8 @@ export const Tooltip = React.forwardRef(
tooltip.addEventListener('toggle', event => {
// @ts-ignore for now
if (event.newState === 'open') {
positionSet()
console.log('Popover has been shown')

Check failure on line 269 in packages/react/src/TooltipV2/Tooltip.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement
positionSet()
} else {
console.log('Popover has been hidden')

Check failure on line 272 in packages/react/src/TooltipV2/Tooltip.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement
}
Expand Down

0 comments on commit ab17b4a

Please sign in to comment.