From 3edacc63e0c4f53afa51db3f3ead7e66d5b9a871 Mon Sep 17 00:00:00 2001 From: storywithoutend Date: Tue, 14 Feb 2023 23:29:52 +0800 Subject: [PATCH] add onShowCallback to Dynamic popover --- .../src/components/atoms/DynamicPopover/DynamicPopover.tsx | 1 + components/src/components/molecules/Tooltip/Tooltip.tsx | 1 - docs/src/reference/mdx/molecules/Tooltip.docs.mdx | 3 +++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/components/src/components/atoms/DynamicPopover/DynamicPopover.tsx b/components/src/components/atoms/DynamicPopover/DynamicPopover.tsx index 5c0fb284..ffb37166 100644 --- a/components/src/components/atoms/DynamicPopover/DynamicPopover.tsx +++ b/components/src/components/atoms/DynamicPopover/DynamicPopover.tsx @@ -298,6 +298,7 @@ export const DynamicPopover = ({ const handleMouseenter = () => { setPosition() toggle(true) + onShowCallback?.() } const handleMouseleave = () => { diff --git a/components/src/components/molecules/Tooltip/Tooltip.tsx b/components/src/components/molecules/Tooltip/Tooltip.tsx index 6b91f851..d2303066 100644 --- a/components/src/components/molecules/Tooltip/Tooltip.tsx +++ b/components/src/components/molecules/Tooltip/Tooltip.tsx @@ -83,7 +83,6 @@ const TooltipPopoverElement = styled.div<{ border-radius: ${theme.radii.large}; padding: ${theme.space['2.5']} ${theme.space['2.5']} ${theme.space['2.5']} ${theme.space['3.5']}; - /* border-color: ${theme.colors.border}; */ background: ${theme.colors.background}; ${injectedCss[$mobilePlacement]} diff --git a/docs/src/reference/mdx/molecules/Tooltip.docs.mdx b/docs/src/reference/mdx/molecules/Tooltip.docs.mdx index 7cae1a17..859a32fb 100644 --- a/docs/src/reference/mdx/molecules/Tooltip.docs.mdx +++ b/docs/src/reference/mdx/molecules/Tooltip.docs.mdx @@ -25,6 +25,9 @@ import { Tooltip, TooltipProps } from '@ensdomains/thorin' placement="top" targetId="buttonIdTop" width={250} + onShowCallback={() => { + alert('shown') + }} >