Skip to content

Commit

Permalink
fix(Tooltip): don't track scroll parent when closeOnScroll not set (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
lexanth committed Oct 28, 2023
1 parent 7354ffb commit b6befea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/shaggy-donkeys-sip.md
@@ -0,0 +1,5 @@
---
"@chakra-ui/tooltip": patch
---

Don't track tooltip scroll parent when `closeOnScroll` is not set
1 change: 1 addition & 0 deletions packages/components/tooltip/src/use-tooltip.ts
Expand Up @@ -212,6 +212,7 @@ export function useTooltip(props: UseTooltipProps = {}) {

useEventListener(
() => {
if (!closeOnScroll) return null
const node = ref.current
if (!node) return null
const scrollParent = getScrollParent(node)
Expand Down

1 comment on commit b6befea

@vercel
Copy link

@vercel vercel bot commented on b6befea Oct 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.