Skip to content

Commit c2045bf

Browse files
authored
Merge pull request #12717 from ethereum/fix-hydartion-tooltips
Fix hydration issue with tooltip and glossary tooltip
2 parents 5d9cbd9 + 67d91c6 commit c2045bf

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/components/Glossary/GlossaryTooltip/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const GlossaryTooltip = ({ children, termKey }: GlossaryTooltipProps) => {
1717
const { asPath } = useRouter()
1818

1919
return (
20-
<Box display="inline-block">
20+
<Box as="span" display="inline-block">
2121
<Tooltip
2222
content={
2323
<GlossaryDefinition

src/components/Tooltip/index.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
PopoverContent,
77
PopoverProps,
88
PopoverTrigger,
9+
Portal,
910
useDisclosure,
1011
} from "@chakra-ui/react"
1112

@@ -67,10 +68,12 @@ const Tooltip: React.FC<IProps> = ({
6768
{...rest}
6869
>
6970
<PopoverTrigger>{children}</PopoverTrigger>
70-
<PopoverContent>
71-
<PopoverArrow />
72-
<PopoverBody>{content}</PopoverBody>
73-
</PopoverContent>
71+
<Portal>
72+
<PopoverContent>
73+
<PopoverArrow />
74+
<PopoverBody>{content}</PopoverBody>
75+
</PopoverContent>
76+
</Portal>
7477
</Popover>
7578
)
7679
}

0 commit comments

Comments
 (0)