Skip to content

fix(event): expose the original event to afterShow and afterHide #466

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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