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

onExit doesn't fire unless viewportSpy is enabled #275

Open
XuluWarrior opened this issue Jul 8, 2021 · 0 comments
Open

onExit doesn't fire unless viewportSpy is enabled #275

XuluWarrior opened this issue Jul 8, 2021 · 0 comments

Comments

@XuluWarrior
Copy link

#270 added the viewportSpy option which means that if it is disabled, after onEnter, stopWatching is called.

This makes sense if you're only considering onEnter but if onExit is defined, then it is counterintuitive that it never gets called unless viewportSpy is set to true.

It took me a while to realise why {{in-viewport onEnter=this.onEnter onExit=this.onExit}} only called my onEnter handler.

I would propose a change to the check on

if (!this.options.viewportSpy) {
to

if (!this.options.viewportSpy && !this.args.named.onExit) {
stopfstedt added a commit to stopfstedt/common that referenced this issue Jul 12, 2023
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

No branches or pull requests

1 participant