Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/tooltip/src/Tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,14 @@ export default class Tooltip extends PureComponent {
} = this.props
const { isShown: stateIsShown, isShownByTarget } = this.state

const shown =
let shown =
(isShown || stateIsShown || isShownByTarget) && !this.isPopoverShown()
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't we also want to respect this.props.isShown here, regardless of !this.isPopoverShown()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think I understand, @jeroenransijn definitely will though! Is this an error I can reproduce?


// Tooltip was explicitly set to not be shown
if (isShown === false) {
shown = false
}

return (
<Positioner
target={({ getRef }) => {
Expand Down
5 changes: 5 additions & 0 deletions src/tooltip/stories/index.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,10 @@ storiesOf('tooltip', module).add('Tooltip', () => (
Hover to trigger
</Text>
</Tooltip>
<Tooltip isShown={false} content="Should never see it">
<Text marginLeft={40} display="inline-block" cursor="help">
Disabled tooltip
</Text>
</Tooltip>
</Box>
))