Skip to content

Commit

Permalink
bring back truncated ceil + only show menu context hover text
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierM committed Jul 17, 2020
1 parent 55da30d commit 2b5fe0d
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ const WithHoverActionsPopover = (styled(EuiPopover as any)`
}
` as unknown) as typeof EuiPopover;

const Container = styled.div`
width: fit-content;
`;

interface Props {
/**
* Always show the hover menu contents (default: false)
Expand Down Expand Up @@ -68,7 +64,10 @@ export const WithHoverActions = React.memo<Props>(
setShowHoverContent(false);
}, []);

const content = useMemo(() => <>{render(showHoverContent)}</>, [render, showHoverContent]);
const content = useMemo(
() => <div onMouseEnter={onMouseEnter}>{render(showHoverContent)}</div>,
[onMouseEnter, render, showHoverContent]
);

useEffect(() => {
setIsOpen(hoverContent != null && (showHoverContent || alwaysShow));
Expand All @@ -79,7 +78,7 @@ export const WithHoverActions = React.memo<Props>(
}, [closePopOverTrigger]);

return (
<Container onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave}>
<div onMouseLeave={onMouseLeave}>
<WithHoverActionsPopover
anchorPosition={'downCenter'}
button={content}
Expand All @@ -90,7 +89,7 @@ export const WithHoverActions = React.memo<Props>(
>
{isOpen ? <>{hoverContent}</> : null}
</WithHoverActionsPopover>
</Container>
</div>
);
}
);
Expand Down

0 comments on commit 2b5fe0d

Please sign in to comment.