Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

Commit

Permalink
fix(Tooltip): support click-to-open with no-icon scenario (#2047)
Browse files Browse the repository at this point in the history
Fixes #2046.
  • Loading branch information
asudoh authored Mar 20, 2019
1 parent 9084f78 commit 5360b4b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/components/Tooltip/Tooltip-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,21 @@ const props = {
tabIndex: number('Tab index (tabIndex in <Tooltip>)', 0),
}),
withoutIcon: () => ({
clickToOpen: boolean(
'Click to open (clickToOpen, using `false` here is deprecated)',
true
),
showIcon: false,
direction: select('Tooltip direction (direction)', directions, 'bottom'),
triggerText: text('Trigger text (triggerText)', 'Tooltip label'),
tabIndex: number('Tab index (tabIndex in <Tooltip>)', 0),
}),
customIcon: () => ({
showIcon: true,
clickToOpen: boolean('Click to open (clickToOpen)', false),
clickToOpen: boolean(
'Click to open (clickToOpen, using `false` here is deprecated)',
true
),
direction: select('Tooltip direction (direction)', directions, 'bottom'),
triggerText: text('Trigger text (triggerText)', 'Tooltip label'),
tabIndex: number('Tab index (tabIndex in <Tooltip>)', 0),
Expand All @@ -64,7 +71,10 @@ const props = {
}),
customIconOnly: () => ({
showIcon: true,
clickToOpen: boolean('Click to open (clickToOpen)', false),
clickToOpen: boolean(
'Click to open (clickToOpen, using `false` here is deprecated)',
true
),
direction: select('Tooltip direction (direction)', directions, 'bottom'),
triggerText: null,
tabIndex: number('Tab index (tabIndex in <Tooltip>)', 0),
Expand Down
2 changes: 2 additions & 0 deletions src/components/Tooltip/Tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,8 @@ class Tooltip extends Component {
ref={mergeRefs(ref, node => {
this.triggerEl = node;
})}
onClick={this.handleMouse}
onKeyDown={this.handleKeyPress}
onMouseOver={this.handleMouse}
onMouseOut={this.handleMouse}
onFocus={this.handleMouse}
Expand Down

0 comments on commit 5360b4b

Please sign in to comment.