You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/options.mdx
+7-4Lines changed: 7 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -103,17 +103,20 @@ import { Tooltip } from 'react-tooltip';
103
103
|`wrapper`| HTML tag | no |`div`|`div``span``p` ... | Element wrapper for the tooltip container, can be `div`, `span`, `p` or any valid HTML tag |
104
104
|`children`| React node | no |`undefined`| valid React children | The tooltip children have lower priority compared to the `content` prop and the `data-tooltip-content` attribute. Useful for setting default content |
105
105
|~~`events`~~|~~`string[]`~~|~~no~~|~~`hover`~~|~~`hover``click`~~|~~Events to watch for when handling the tooltip state~~ <br/>**DEPRECATED**<br/>Use `openOnClick` tooltip prop instead |
106
-
|`openOnClick`|`boolean`| no |`false`|`true``false`|Controls whether the tooltip should open when clicking (`true`) or hovering (`false`) the anchor element |
106
+
|`openOnClick`|`boolean`| no |`false`|`true``false`|When enabled, the tooltip will open on click instead of on hover. Use `openEvents`, `closeEvents`, and `globalCloseEvents` for more customization|
107
107
|`positionStrategy`|`string`| no |`absolute`|`absolute``fixed`| The position strategy used for the tooltip. Set to `fixed` if you run into issues with `overflow: hidden` on the tooltip parent container |
108
108
|`delayShow`|`number`| no || any `number`| The delay (in ms) before showing the tooltip |
109
109
|`delayHide`|`number`| no || any `number`| The delay (in ms) before hiding the tooltip |
110
110
|`float`|`boolean`| no |`false`|`true``false`| Tooltip will follow the mouse position when it moves inside the anchor element (same as V4's `effect="float"`) |
111
111
|`hidden`|`boolean`| no |`false`|`true``false`| Tooltip will not be shown |
112
112
|`noArrow`|`boolean`| no |`false`|`true``false`| Tooltip arrow will not be shown |
113
113
|`clickable`|`boolean`| no |`false`|`true``false`| Allow interaction with elements inside the tooltip. Useful when using buttons and inputs |
114
-
|`closeOnEsc`|`boolean`| no |`false`|`true``false`| Pressing escape key will close the tooltip |
115
-
|`closeOnScroll`|`boolean`| no |`false`|`true``false`| Scrolling will close the tooltip (for this to work, scroll element must be either the root html tag, the tooltip parent, or the anchor parent) |
116
-
|`closeOnResize`|`boolean`| no |`false`|`true``false`| Resizing the window will close the tooltip |
114
+
|~~`closeOnEsc`~~|~~`boolean`~~|~~no~~|~~`false`~~|~~`true``false`~~|~~Pressing escape key will close the tooltip~~ <br/>**DEPRECATED**<br/>Use `globalCloseEvents` instead. |
115
+
|~~`closeOnScroll`~~|~~`boolean`~~|~~no~~|~~`false`~~|~~`true``false`~~|~~Scrolling will close the tooltip~~ <br/>**DEPRECATED**<br/>Use `globalCloseEvents` instead. |
116
+
|~~`closeOnResize`~~|~~`boolean`~~|~~no~~|~~`false`~~|~~`true``false`~~|~~Resizing the window will close the tooltip~~ <br/>**DEPRECATED**<br/>Use `globalCloseEvents` instead. |
117
+
|`openEvents`|`Record<string, boolean>`| no |`mouseenter``focus`|`mouseenter``focus``click``dblclick``mousedown`| Events to be listened on the anchor elements to open the tooltip |
118
+
|`closeEvents`|`Record<string, boolean>`| no |`mouseleave``blur`|`mouseleave``blur``click``dblclick``mouseup`| Events to be listened on the anchor elements to close the tooltip |
119
+
|`globalCloseEvents`|`Record<string, boolean>`| no ||`escape``scroll``resize``clickOutsideAnchor`| Global events to be listened to close the tooltip (`escape` closes on pressing `ESC`, `clickOutsideAnchor` is useful with click events on `openEvents`) |
117
120
|`style`|`CSSProperties`| no || a CSS style object | Add inline styles directly to the tooltip |
118
121
|`position`|`{ x: number; y: number }`| no || any `number` value for both `x` and `y`| Override the tooltip position on the DOM |
119
122
|`isOpen`|`boolean`| no ||`true``false`| The tooltip can be controlled or uncontrolled, this attribute can be used to handle show and hide tooltip outside tooltip (can be used **without**`setIsOpen`) |
Copy file name to clipboardExpand all lines: docs/docs/upgrade-guide/changelog-v4-v5.md
+13-7Lines changed: 13 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -50,9 +50,15 @@ If you run into any problems with the tooltip not updating after changes are mad
50
50
-[x]`float` - `boolean` - used to achieve V4's `effect="float"`
51
51
-[x]`hidden` - `boolean` - when set, the tooltip will not show
52
52
-[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)
53
-
-[x]`closeOnEsc` - `boolean` - when set, the tooltip will close after pressing the escape key
54
-
-[x]`closeOnScroll` - `boolean` - when set, the tooltip will close when scrolling (similar to V4's `scrollHide`)
55
-
-[x]`closeOnResize` - `boolean` - when set, the tooltip will close when resizing the window (same as V4's `resizeHide`)
53
+
-[x]`closeOnEsc` - **DEPRECATED** - ~~`boolean` - when set, the tooltip will close after pressing the escape key~~
54
+
-[x]`closeOnScroll` - **DEPRECATED** - ~~`boolean` - when set, the tooltip will close when scrolling (similar to V4's `scrollHide`)~~
55
+
-[x]`closeOnResize` - **DEPRECATED** - ~~`boolean` - when set, the tooltip will close when resizing the window (same as V4's `resizeHide`)~~
56
+
57
+
:::note
58
+
59
+
Use `globalCloseEvents` instead of `closeOnEsc`, `closeOnScroll`, and `closeOnResize`. See the [options page](../options.mdx#available-props) for more details.
60
+
61
+
:::
56
62
57
63
## `V4` props available in `V5`
58
64
@@ -78,10 +84,10 @@ If you run into any problems with the tooltip not updating after changes are mad
78
84
-[x]`delayHide` - also available on anchor element as `data-delay-hide`
79
85
-[ ]`delayUpdate` - can be implemented if requested
80
86
-[x]`delayShow` - also available on anchor element as `data-delay-show`
81
-
-[]`event`
82
-
-[]`eventOff`
87
+
-[x]`event` - functionality changed and renamed to `openEvents`
88
+
-[x]`eventOff` - functionality changed and renamed to `closeEvents`
83
89
-[ ]`isCapture`
84
-
-[]`globalEventOff`
90
+
-[x]`globalEventOff` - functionality changed and renamed to `globalCloseEvents`
85
91
-[ ]`getContent` - pass dynamic values to `content` instead
86
92
-[x]`afterShow`
87
93
-[x]`afterHide`
@@ -92,7 +98,7 @@ If you run into any problems with the tooltip not updating after changes are mad
92
98
-[x]`wrapper` - also available on anchor element as `data-tooltip-wrapper`
93
99
-[ ]`bodyMode`
94
100
-[x]`clickable`
95
-
-[]`disableInternalStyle`
101
+
-[x]`disableInternalStyle` - renamed to `disableStyleInjection`
0 commit comments