Skip to content

Commit

Permalink
Merge pull request #466 from wwayne/event_passthrough
Browse files Browse the repository at this point in the history
fix(event): expose the original event to `afterShow` and `afterHide`
  • Loading branch information
aronhelser authored Jan 4, 2019
2 parents 718880e + e2f973e commit 9e876e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 9e876e1

Please sign in to comment.