Unobserve status on unmount (#4013)
This fixes a warning on status unmounting (e.g. deletion). This also resets IntersectionObserverWrapper on disconnect to avoid `unobserve()` calls which has bug in Edge.
This commit is contained in:
@ -37,9 +37,18 @@ class IntersectionObserverWrapper {
|
||||
}
|
||||
}
|
||||
|
||||
unobserve (id, node) {
|
||||
if (this.observer) {
|
||||
delete this.callbacks[id];
|
||||
this.observer.unobserve(node);
|
||||
}
|
||||
}
|
||||
|
||||
disconnect () {
|
||||
if (this.observer) {
|
||||
this.callbacks = {};
|
||||
this.observer.disconnect();
|
||||
this.observer = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user