-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Description
If you init an IntersectionController with a target (oldTarget), and then observe another target with IntersectionController.observe(newTarget) (meaning to override oldTarget), if the host is disconnected then reconnected, then oldTarget is the only target that is observed and not newTarget.
Steps to Reproduce
- Init an
intersectionObserverwith a target - call
IntersectionObserver.observewith a new target - disconnect the custom element
- reconnect the custom element
- note that the instersectionController is only being called with the old target
Live Reproduction Link
https://lit.dev/playground/#gist=92c47a7579efd223f8490988e6f47efb
- Scroll up and down to see the log update
- Observe the targets being observed
- click the
Disconnect the CEbutton - click the
Reconnect the CEbutton - scroll around again and observe only
outsideDivis being called
Expected Results
After reconnect, target: intendedTarget should be logged.
Personally I think there should be a way to unobserve the constructor's target, but if not, calling this.observe(A) should re-observe on element A on host reconnect
Actual Results
After reconnect, only target: oldTarget is logged.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
✅ Done