Skip to content
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 viewportTolerance with defaults #122

Merged
merged 1 commit into from
Feb 8, 2018
Merged

Conversation

snewcomer
Copy link
Collaborator

@bkoval This is completely my fault. I didn't have a test for the viewportTolerance.

This is a small fix, but in reality there still are a few things we can still improve - better tests for viewportTolerance and intersectionThreshold, allow % for viewportTolerance in the IntersectionObserver case, etc. I'll make a follow up issue.

References #121

@snewcomer snewcomer added the bug label Feb 7, 2018
@snewcomer snewcomer self-assigned this Feb 7, 2018
{{/my-component}}
`);

assert.equal(this.$().text().trim(), 'template block text');
Copy link
Collaborator Author

@snewcomer snewcomer Feb 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests are definitely not comprehensive, but would like to build on them. Also will add an acceptance test where there is a very large target element and set the intersectionObserver to 1.0 and ensure nothing is fired until scroll to bottom of target in a follow up PR.

@@ -98,7 +98,7 @@ export default Mixin.create({
}

if (get(this, 'viewportUseIntersectionObserver')) {
const { top, left, bottom, right } = this.viewportTolerance;
const { top = 0, left = 0, bottom = 0, right = 0 } = this.viewportTolerance;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the root issue in the IntersectionObserver case.

@snewcomer
Copy link
Collaborator Author

Only one change to the in-viewport mixin. Will merge this morning if everybody is ok with this.

@snewcomer snewcomer merged commit 800d2c6 into master Feb 8, 2018
@snewcomer snewcomer deleted the fix-viewport-tolerance branch February 8, 2018 18:46
@bkoval
Copy link

bkoval commented Feb 12, 2018

Thanks so much @snewcomer - super quick reaction!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants