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
Checking for intersection on transitionend/animationend #212
Conversation
Can you add a test for this? |
Any update on this @bdadam ? I can pick it up if you want |
@@ -254,6 +254,8 @@ IntersectionObserver.prototype._monitorIntersections = function() { | |||
else { | |||
addEvent(window, 'resize', this._checkForIntersections, true); | |||
addEvent(document, 'scroll', this._checkForIntersections, true); | |||
addEvent(document, 'transitionend', this._checkForIntersections, true); |
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.
We need to remove the event on unobserve()
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.
You are right.
Hey @luinova, thanks for your offer. I kind of forgot about this. I struggled with the tests what @philipwalton asked for. But now I have a new idea, I will try it out later today or tomorrow. I still would like this PR to be merged, because I will need this feature. |
@bdadam awesome! |
Please merge the requested change to the Our apologies for the inconvenience. |
@bdadam Can you join the WICG to appease the IPR bots? |
Given the lack of movement here (and lack of tests), I propose we close the PR. If someone would like to pick it up again, we can certainly re-open. :) |
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 polyfill checks for intersections when
animationend
ortransitionend
events are fired. Not only onresize
orscroll
. Doing these new checks should still be cheap, because these events are only fired once the movement of the element is finished.