Skip to content

Commit efc7f8c

Browse files
committed
chore(website): Fix tooltip dense demo
1 parent 4772c88 commit efc7f8c

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

packages/documentation/src/components/Demos/Tooltip/DenseTooltipsWrapper.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@ interface CSSVariable {
99

1010
const VARIABLES: CSSVariable[] = [
1111
{
12-
name: "rmd-tooltip-font-size",
12+
name: "--rmd-tooltip-font-size",
1313
value: scssVariables["rmd-tooltip-font-size"],
1414
},
1515
{
16-
name: "rmd-tooltip-line-height",
16+
name: "--rmd-tooltip-line-height",
1717
value: scssVariables["rmd-tooltip-line-height"],
1818
},
1919
{
20-
name: "rmd-tooltip-min-height",
20+
name: "--rmd-tooltip-min-height",
2121
value: scssVariables["rmd-tooltip-min-height"],
2222
},
2323
{
24-
name: "rmd-tooltip-horizontal-padding",
24+
name: "--rmd-tooltip-horizontal-padding",
2525
value: scssVariables["rmd-tooltip-horizontal-padding"],
2626
},
2727
{
28-
name: "rmd-tooltip-vertical-padding",
28+
name: "--rmd-tooltip-vertical-padding",
2929
value: scssVariables["rmd-tooltip-line-wrap-vertical-padding"],
3030
},
3131
];
@@ -47,9 +47,7 @@ export default function DenseTooltipsWrapper({
4747
const mode = useUserInteractionMode();
4848

4949
const enableVariables = (): void => {
50-
if (!variables.length) {
51-
setVariables(VARIABLES);
52-
}
50+
setVariables(VARIABLES);
5351
};
5452

5553
useEffect(() => {
@@ -61,7 +59,8 @@ export default function DenseTooltipsWrapper({
6159
if (
6260
!container.current ||
6361
!event.target ||
64-
!container.current.contains(event.target as Node)
62+
!(event.target instanceof Node) ||
63+
!container.current.contains(event.target)
6564
) {
6665
setVariables([]);
6766
}

0 commit comments

Comments
 (0)