Skip to content

Commit

Permalink
chore(website): Fix tooltip dense demo
Browse files Browse the repository at this point in the history
  • Loading branch information
mlaursen committed Mar 9, 2022
1 parent 4772c88 commit efc7f8c
Showing 1 changed file with 8 additions and 9 deletions.
Expand Up @@ -9,23 +9,23 @@ interface CSSVariable {

const VARIABLES: CSSVariable[] = [
{
name: "rmd-tooltip-font-size",
name: "--rmd-tooltip-font-size",
value: scssVariables["rmd-tooltip-font-size"],
},
{
name: "rmd-tooltip-line-height",
name: "--rmd-tooltip-line-height",
value: scssVariables["rmd-tooltip-line-height"],
},
{
name: "rmd-tooltip-min-height",
name: "--rmd-tooltip-min-height",
value: scssVariables["rmd-tooltip-min-height"],
},
{
name: "rmd-tooltip-horizontal-padding",
name: "--rmd-tooltip-horizontal-padding",
value: scssVariables["rmd-tooltip-horizontal-padding"],
},
{
name: "rmd-tooltip-vertical-padding",
name: "--rmd-tooltip-vertical-padding",
value: scssVariables["rmd-tooltip-line-wrap-vertical-padding"],
},
];
Expand All @@ -47,9 +47,7 @@ export default function DenseTooltipsWrapper({
const mode = useUserInteractionMode();

const enableVariables = (): void => {
if (!variables.length) {
setVariables(VARIABLES);
}
setVariables(VARIABLES);
};

useEffect(() => {
Expand All @@ -61,7 +59,8 @@ export default function DenseTooltipsWrapper({
if (
!container.current ||
!event.target ||
!container.current.contains(event.target as Node)
!(event.target instanceof Node) ||
!container.current.contains(event.target)
) {
setVariables([]);
}
Expand Down

1 comment on commit efc7f8c

@vercel
Copy link

@vercel vercel bot commented on efc7f8c Mar 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.