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

chore: emit 'NotVisible' events when target element moves out of viewport #1433

Merged
merged 3 commits into from
May 23, 2023

Conversation

janjoosse
Copy link
Contributor

@janjoosse janjoosse commented May 17, 2023

PR Type

[X] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no API changes)
[ ] Build-related changes
[ ] CI-related changes
[ ] Documentation content changes
[ ] Application / infrastructure changes
[ ] Other:

What Is the Current Behavior?

Currently the ishIntersectionObserver can be used as directive on a target element to determine whether the element is visible. Whenever the element moves into view and becomes visible it will emit the IntersectionStatus Visible. Given the type definition for IntersectionStatus [export type IntersectionStatus = 'Visible' | 'Pending' | 'NotVisible';] I would expect that the directive also emits a NotVisible event when the target element becomes invisible. This is not the case, it only emits Pending and Visible statuses.

What Is the New Behavior?

The ishIntersectionObserver also emits NotVisible status.

Does this PR Introduce a Breaking Change?

[ ] Yes
[X] No

Other Information

@janjoosse janjoosse marked this pull request as ready for review May 17, 2023 15:57
@suschneider suschneider requested a review from shauke May 22, 2023 12:09
@suschneider suschneider assigned suschneider and shauke and unassigned suschneider May 22, 2023
@shauke shauke added this to the 4.1 milestone May 23, 2023
shauke
shauke previously approved these changes May 23, 2023
Copy link
Collaborator

@shauke shauke left a comment

Choose a reason for hiding this comment

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

You are right, there is no need to filter the NotVisible events.
The usage in this project filters on the events themselves.

…Visible` status change as well

BREAKING CHANGES: The `ishIntersectionObserver` returns `NotVisible` status now too (see [Migrations / 4.0 to 4.1](https://github.com/intershop/intershop-pwa/blob/develop/docs/guides/migrations.md#40-to-41) for more details).
@shauke shauke merged commit 237a1a8 into intershop:develop May 23, 2023
@janjoosse janjoosse deleted the chore/emit-notvisible-events branch May 23, 2023 17:10
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.

4 participants