Skip to content

Commit 47b16fd

Browse files
docs(troubleshooting): scrolling should not be an issue anymore
1 parent a64221b commit 47b16fd

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

Diff for: docs/docs/troubleshooting.mdx

-29
Original file line numberDiff line numberDiff line change
@@ -64,35 +64,6 @@ If you've imported the default styling and the tooltip is still not showing up w
6464

6565
If `data-tooltip-content` and `data-tooltip-html` are both unset (or they have empty values) on the anchor element, and also the `content`, `render`, and `children` props on the tooltip are unset (or have empty values), the tooltip is not shown by default.
6666

67-
68-
## The tooltip doesn't move when scrolling
69-
70-
If your anchor element is inside a scrolling element, your tooltip might get "stuck" in place when scrolling.
71-
There are two ways to avoid this.
72-
73-
### Change your CSS (recommended)
74-
75-
For the tooltip to be properly placed inside a scrolling element, the following conditions must be met:
76-
77-
1. The tooltip component has to be inside the scrolling element (placing it as a direct child is **not** required)
78-
2. The `positionStrategy` tooltip prop must be unset, or set to the default (`absolute`)
79-
3. The scrolling element should have the CSS attribute `position: relative`
80-
81-
:::info
82-
83-
The `position: relative` attribute can be set on any element on the DOM structure between the scrolling element and the tooltip.
84-
This means the tooltip component doesn't have to be a direct child of the scrolling element.
85-
86-
:::
87-
88-
### Use `closeOnScroll` prop
89-
90-
```tsx
91-
<Tooltip closeOnScroll={true} />
92-
```
93-
94-
When `closeOnScroll` is set, scrolling will immediately close the tooltip (`closeOnResize` also exists for closing when resizing the window).
95-
9667
## Bad performance
9768

9869
If you're experiencing any kind of unexpected behavior or bad performance on your application when using ReactTooltip, here are a few things you can try.

0 commit comments

Comments
 (0)