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

Pass the intersectionObserverEntry to callbacks of {{in-vieport}} modifier #278

Merged
merged 7 commits into from
Oct 14, 2021

Conversation

cibernox
Copy link
Contributor

When using the {{in-viewport}} modifier, the intersectionObserverEntry property was not being
passed to the onEnter/onExit callbacks. This object is interesting because contains useful info
like the intersection ratio, which can use to discriminate what visibility threshold an element
has crossed when there's more than one set.

…ifier

When using the {{in-viewport}} modifier, the intersectionObserverEntry property was not being
passed to the onEnter/onExit callbacks. This object is interesting because contains useful info
like the intersection ratio, which can use to discriminate what visibility threshold an element
has crossed when there's more than one set.
@cibernox cibernox self-assigned this Oct 13, 2021
Supporting them would require ember-auto-update 2, which would require a major version bump
Copy link

@cbroeren cbroeren left a comment

Choose a reason for hiding this comment

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

I'm not yet familiar with the detailed implementation of this addon, but change seems straight forward to me. Had just one question / suggestion. Will take a closer look tomorrow.

addon/modifiers/in-viewport.js Outdated Show resolved Hide resolved
ember-beta,
ember-default-with-jquery,
ember-classic
# ember-beta,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had to comment this because tests don't pass in Ember 4.0 for reasons unrelated with this PR.
Fixing it should be relatively straightforward by updating ember-auto-import, but reading the migration guide seems that doing so would make this addon only consumable by apps using ember-auto-import >=2.0, granting it a major version bump.

I wasn't sure I wanted that mixed with this very simple change.

Copy link
Contributor

Choose a reason for hiding this comment

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

@cibernox note #281 which upgrades ember-auto-import and would need major version bump

@cibernox cibernox merged commit af616a9 into master Oct 14, 2021
@cibernox cibernox deleted the pass-intersection-observer-entry-down-the-line branch October 14, 2021 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants