24
Views
1
Comments
[Web API Intersection Observer] Missing OnDestroy event handler
web-api-intersection-observer
Reactive icon
Forge asset by Barduino
Application Type
Reactive

Hi,

We're using this component but have noticed that the OnDestroy should be implemented to disconnect the observer.  Otherwise you can get javascript errors when the observer triggers and the root or target elements no longer exist.

So we ended up adding the following to fix the issue:

OnDestroy (Javascript block): 

$parameters.ObserverObj.disconnect();

Can this be added to the component?

Kind regards,

Steven

2025-07-26 20-43-45
Ivo Frazão

Hello, Steven.

I've uploaded a new version which adds the OnDestroy of the block.

It also allows you to call programmatically the disconnect method on a observer.


Hope it helps :)


Kind regards,

Ivo

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.