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

inview and onscreen events not triggered when element off screen #630

Open
danielghost opened this issue Feb 26, 2025 · 0 comments · May be fixed by #633
Open

inview and onscreen events not triggered when element off screen #630

danielghost opened this issue Feb 26, 2025 · 0 comments · May be fixed by #633
Assignees
Labels

Comments

@danielghost
Copy link
Contributor

With the changes applied in https://github.com/adaptlearning/adapt-contrib-core/releases/tag/v6.55.0, it seems that the inview and onscreen events no longer trigger when an element moves off screen. This means listeners such as https://github.com/adaptlearning/adapt-contrib-media/blob/e8b08fa5d5fe45ba2d0f95aa4675b9764c8e7dfd/js/mediaView.js#L310-L312 won't pause playback when off screen.

This seems to be caused by the addition of returning early if !measurement.onscreen when the library was rewritten:

if (!hasMeasureChanged || !measurement.onscreen) return;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Needs Reviewing
Development

Successfully merging a pull request may close this issue.

1 participant