Skip to content

Commit

Permalink
docs: fix descriptions for closeOnScroll
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieljablonski committed Jun 22, 2023
1 parent 4e9c471 commit 0414a54
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
12 changes: 3 additions & 9 deletions docs/docs/troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,13 @@ This means the tooltip component doesn't have to be a direct child of the scroll

:::

### Use `closeOnEsc` prop
### Use `closeOnScroll` prop

```tsx
<Tooltip closeOnEsc={true} />
<Tooltip closeOnScroll={true} />
```

When `closeOnEsc` is set, scrolling will immediately close the tooltip (`closeOnResize` also exists for closing when resizing the window).

:::caution

For this to work properly, the scrolling element must either be the root `html` tag, the tooltip parent element, or the anchor parent element.

:::
When `closeOnScroll` is set, scrolling will immediately close the tooltip (`closeOnResize` also exists for closing when resizing the window).

## Bad performance

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/upgrade-guide/changelog-v4-v5.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ If you run into any problems with the tooltip not updating after changes are mad
- [x] `hidden` - `boolean` - when set, the tooltip will not show
- [x] `render` - `function` - can be used to render dynamic content based on the active anchor element (check [the examples](../examples/render.mdx) for more details)
- [x] `closeOnEsc` - `boolean` - when set, the tooltip will close after pressing the escape key
- [x] `closeOnScroll` - `boolean` - when set, the tooltip will close when scrolling the root html tag, the tooltip parent, or the anchor parent (similar to V4's `scrollHide`)
- [x] `closeOnScroll` - `boolean` - when set, the tooltip will close when scrolling (similar to V4's `scrollHide`)
- [x] `closeOnResize` - `boolean` - when set, the tooltip will close when resizing the window (same as V4's `resizeHide`)

## `V4` props available in `V5`
Expand Down

0 comments on commit 0414a54

Please sign in to comment.