Skip to content

Commit

Permalink
fix(event): expose the original event to afterShow and afterHide
Browse files Browse the repository at this point in the history
Originally contributed by cjzcpsyx <Jianzhong Chen>,
add docs and reformat commit message.
  • Loading branch information
aronhelser committed Jan 3, 2019
1 parent 07d48ef commit e2f973e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -71,8 +71,8 @@ className | data-class | String | | extra custom class, can use !importan
insecure | null | Bool | true, false | Whether to inject the style header into the page dynamically (violates CSP style-src but is a convenient default)
border | data-border | Bool | true, false | Add one pixel white border
getContent | null | Func or Array | (dataTip) => {}, [(dataTip) => {}, Interval] | Generate the tip content dynamically
afterShow | null | Func | () => {} | Function that will be called after tooltip show
afterHide | null | Func | () => {} | Function that will be called after tooltip hide
afterShow | null | Func | (evt) => {} | Function that will be called after tooltip show, with event that triggered show
afterHide | null | Func | (evt) => {} | Function that will be called after tooltip hide, with event that triggered hide
disable | data-tip-disable | Bool | true, false | Disable the tooltip behaviour, default is false
scrollHide | data-scroll-hide | Bool | true, false | Hide the tooltip when scrolling, default is true
resizeHide | null | Bool | true, false | Hide the tooltip when resizing the window, default is true
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Expand Up @@ -389,7 +389,7 @@ class ReactTooltip extends React.Component {
show: true
}, () => {
this.updatePosition()
if (isInvisible && afterShow) afterShow()
if (isInvisible && afterShow) afterShow(e)
})
}
}
Expand Down Expand Up @@ -450,7 +450,7 @@ class ReactTooltip extends React.Component {
show: false
}, () => {
this.removeScrollListener()
if (isVisible && afterHide) afterHide()
if (isVisible && afterHide) afterHide(e)
})
}

Expand Down

0 comments on commit e2f973e

Please sign in to comment.