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
Setting the opacity through CSS directly on the tooltip element breaks functionality. Use the `opacity` prop, or override the `--rt-opacity` CSS variable instead.
Copy file name to clipboardExpand all lines: docs/docs/troubleshooting.mdx
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,34 @@ If you've imported the default styling and the tooltip is still not showing up w
64
64
65
65
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.
66
66
67
+
## The tooltip doesn't close
68
+
69
+
This usually happens when you try to set the tooltip opacity via CSS. Due to the opacity being used internally to control the tooltip state, overriding it breaks functionality.
70
+
71
+
Instead, use the `opacity` prop, or override the `--rt-opacity` CSS variable. See [the examples](./examples/styling#changing-the-opacity) for more details.
72
+
73
+
```jsx
74
+
<Tooltip opacity={1} />
75
+
```
76
+
77
+
or
78
+
79
+
```css
80
+
:root {
81
+
--rt-opacity: 1;
82
+
}
83
+
```
84
+
85
+
## The border doesn't show for the arrow
86
+
87
+
Simply setting the border for the tooltip through CSS will not work for the arrow.
88
+
89
+
Instead, use [the `border` prop](./examples/styling#changing-the-border).
90
+
91
+
```jsx
92
+
<Tooltip border="1px solid red"/>
93
+
```
94
+
67
95
## Bad performance
68
96
69
97
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