Skip to content

Commit

Permalink
Merge pull request #85 from storybookjs/fix-tooltip-hover
Browse files Browse the repository at this point in the history
Add delayHide prop to tooltip for better hover behavior
  • Loading branch information
domyen authored Oct 7, 2019
2 parents 9cb4c78 + 95f0e81 commit 914971d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/tooltip/WithTooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ function WithTooltip({
tooltip,
children,
startOpen,
delayHide,
...props
}) {
const id = React.useMemo(() => uuid.v4(), []);
Expand All @@ -112,6 +113,7 @@ function WithTooltip({

return (
<TooltipTrigger
delayHide={delayHide}
placement={placement}
trigger={trigger}
tooltipShown={isTooltipShown}
Expand Down Expand Up @@ -165,6 +167,7 @@ WithTooltip.propTypes = {
tooltip: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
children: PropTypes.node.isRequired,
startOpen: PropTypes.bool,
delayHide: PropTypes.number,
};

WithTooltip.defaultProps = {
Expand All @@ -175,6 +178,7 @@ WithTooltip.defaultProps = {
modifiers: {},
hasChrome: true,
startOpen: false,
delayHide: 100,
};

export default WithTooltip;

0 comments on commit 914971d

Please sign in to comment.