-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
fix(src/index.js): Overwrite delayHide
on scroll
#504
Conversation
@aronhelser gentle ping 🙏 Thank you! |
src/index.js
Outdated
|
||
const hideTooltip = (event, hasTarget) => this.hideTooltip(event, hasTarget, { isScroll: true }) | ||
|
||
window.addEventListener('scroll', hideTooltip, isCaptureMode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function added here no longer matches this.hideTooltip
inside removeScrollListener
, and I think that's a problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @aronhelser! Thanks so much for taking the time to check the PR 🙏
Ahh I see, so since window.addEventListener('scroll', hideTooltip, isCaptureMode)
refers to a different function from this.hideTooltip
, window.removeEventListener('scroll', this.hideTooltip)
won't be able to clear const hideTooltip
, and thus introducing memory leak.
Will need to think about a way around this 👍
Thanks for catching that!
Add new param `options` to `hideTooltip()` and update `addScrollListener()` to set `options` to `{ isScroll: true }`, so `hideTooltip()` can set `delayHide` to `0` if `isScroll` is `true` fix #474
Hi @aronhelser! I just updated the PR to use a new method PTAL again 🙏 Thank you! |
Awesome, thanks! |
🎉 This PR is included in version 3.11.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Hurray! Thanks again for the great review, @aronhelser ! Have an amazing weekend! |
Add new param
options
tohideTooltip()
and updateaddScrollListener()
to set
options
to{ isScroll: true }
, sohideTooltip()
can setdelayHide
to0
ifisScroll
istrue
fix #474