From 047977c8e0b52664f7181758af6a44a57c916795 Mon Sep 17 00:00:00 2001 From: csand Date: Thu, 22 Oct 2015 16:31:47 -0400 Subject: [PATCH 1/2] Prevent unsetting viewportEntered when not spying When scrolling through a large list of components with the InViewport mixin, the `_triggerDidAccessViewport` method can set the `viewportEntered` property to false after listeners for the component have been unbound, causing the components to remain stuck in their outside viewport state. `viewportEntered` should only be set back to false if the spy is being used. --- addon/mixins/in-viewport.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addon/mixins/in-viewport.js b/addon/mixins/in-viewport.js index fd007267..fd732480 100644 --- a/addon/mixins/in-viewport.js +++ b/addon/mixins/in-viewport.js @@ -134,7 +134,9 @@ export default Mixin.create({ triggeredEventName = 'didExitViewport'; } - set(this, 'viewportEntered', hasEnteredViewport); + if (get(this, 'viewportSpy') || !viewportEntered) { + set(this, 'viewportEntered', hasEnteredViewport); + } this.trigger(triggeredEventName); }, From bc2767938a30341bb019b773947268986ea2556f Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Thu, 3 Dec 2015 20:36:24 -0500 Subject: [PATCH 2/2] Version bump to 2.0.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 66fac420..fc3ca457 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ember-in-viewport", - "version": "2.0.2", + "version": "2.0.3", "description": "Detect if an Ember View or Component is in the viewport @ 60FPS", "directories": { "doc": "doc",