Skip to content

Commit ab17b4a

Browse files
test delay animation
1 parent d9ffbe8 commit ab17b4a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/react/src/TooltipV2/Tooltip.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const animationStyles = `
1616
animation-duration: 0.1s;
1717
animation-fill-mode: forwards;
1818
animation-timing-function: ease-in;
19-
animation-delay: 0s;
19+
animation-delay: 1s;
2020
`
2121

2222
const StyledTooltip = styled.div`
@@ -198,6 +198,7 @@ export const Tooltip = React.forwardRef(
198198
const openTooltip = () => {
199199
if (tooltipElRef.current && triggerRef.current && !tooltipElRef.current.matches(':popover-open')) {
200200
tooltipElRef.current.showPopover()
201+
console.log('popover open', tooltipElRef.current.matches(':popover-open'))
201202
}
202203
}
203204
const closeTooltip = () => {
@@ -252,13 +253,11 @@ export const Tooltip = React.forwardRef(
252253
}
253254

254255
const positionSet = () => {
255-
console.log('top', tooltip.style.top)
256-
console.log('left', tooltip.style.left)
257-
258256
const {top, left, anchorAlign, anchorSide} = getAnchoredPosition(tooltip, trigger, settings)
259257

260258
tooltip.style.top = `${top}px`
261259
tooltip.style.left = `${left}px`
260+
console.log('positionSet')
262261
// 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
263262
const calculatedDirection = positionToDirection[`${anchorSide}-${anchorAlign}` as string]
264263
setCalculatedDirection(calculatedDirection)
@@ -267,8 +266,8 @@ export const Tooltip = React.forwardRef(
267266
tooltip.addEventListener('toggle', event => {
268267
// @ts-ignore for now
269268
if (event.newState === 'open') {
270-
positionSet()
271269
console.log('Popover has been shown')
270+
positionSet()
272271
} else {
273272
console.log('Popover has been hidden')
274273
}

0 commit comments

Comments
 (0)