-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Tooltip): add ability to disable autohide on tooltip content ho…
…ver (#149) * feat(Tooltip): add ability to disable autohide on tooltip content hover * docs(Tooltip): add example of disabling autohide
- Loading branch information
1 parent
0de52de
commit 68a0ed7
Showing
5 changed files
with
165 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* eslint react/no-multi-comp: 0, react/prop-types: 0 */ | ||
import React from 'react'; | ||
import { Tooltip } from 'reactstrap'; | ||
|
||
export default class Example extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
|
||
this.toggle = this.toggle.bind(this); | ||
this.state = { | ||
tooltipOpen: false | ||
}; | ||
} | ||
|
||
toggle() { | ||
this.setState({ | ||
tooltipOpen: !this.state.tooltipOpen | ||
}); | ||
} | ||
|
||
render() { | ||
return ( | ||
<div> | ||
<p>Sometimes you need to allow users to select text within a <a href="#" id="DisabledAutoHideExample">tooltip</a>.</p> | ||
<Tooltip placement="top" isOpen={this.state.tooltipOpen} autohide={false} target="DisabledAutoHideExample" toggle={this.toggle}> | ||
Try to select this text! | ||
</Tooltip> | ||
</div> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters