Skip to content

Commit

Permalink
Add tabIndex prop
Browse files Browse the repository at this point in the history
  • Loading branch information
tvkhoa committed Aug 3, 2017
1 parent 6109112 commit 60b70be
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const HeaderWithTootip = withTooltip(Header, {
|onRequestClose|`noop function`|Function|Just only use it if you want to `show/hide it manually`. This event is fired when you click outside of your tooltip, should be used with the prop `interaction` to keep your tooltip showing|
|position|`top`|`top` `bottom` `left` `right`|Specifies which direction to position the tooltip on the element. Add the suffix `-start` or `-end` to shift the position. `top-end` is an example.|
|trigger|`mouseenter focus`|`mouseenter` `focus` `click` `manual`|Specifies which type of events will trigger a tooltip to show. Separate each by a space. mouseenter is for hovering and touch on mobile, and focus is for keyboard navigation. Use manual if you want to show/hide the tooltip manually/programmatically (see below).|
|tabIndex|`undefined`|number|set tabIndex so element can receive focus|
|interactive|`false`|`true` `false`|Makes a tooltip interactive, i.e. will not close when the user hovers over or clicks on the tooltip. This lets you create a popover (similar to Bootstrap) when used in conjunction with a click trigger.|
|interactiveBorder|2|Any number (pixels)|Specifies the size of the invisible border around an interactive tooltip that will prevent it from closing. Only applies to `mouseenter` triggered tooltips.|
|delay|0|Any integer >= 0 (milliseconds)|Specifies how long it takes after a trigger event is fired for a tooltip to show.|
Expand Down
3 changes: 2 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ class App extends Component {

{!disabled && (
<Tooltip
trigger="click"
trigger="focus"
tabIndex={0}
unmountHTMLWhenHide
useContext
html={(
Expand Down
1 change: 1 addition & 0 deletions src/Tooltip/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ class Tooltip extends Component {
ref={(tooltip) => { this.tooltipDOM = tooltip; }}
title={this.props.title}
className={this.props.className}
tabIndex={this.props.tabIndex}
style={{
display: 'inline',
...this.props.style
Expand Down

0 comments on commit 60b70be

Please sign in to comment.