Try to replace the polling and excessive MutationObserver usage in delite/popup.
Currently it uses polling to check if:
the popup changed size due to an animation event (#501)
the anchor node moved due to scrolling of the viewport or an inner node
It also uses MutationObserver to check if the popup changed size due to DOM nodes being added/removed, classes changed, etc.
While we still need to use MutationObserver to detect if the popup's class has changed, we can use #505 to detect if the size has changed.
As for scrolling, we can detect scrolling on the viewport or a nested element via:
document.addEventListener("scroll", function () { console.log("document scroll capture"); }, true)
We can even check whether the evt.target is an ancestor of the anchor node or not. Perhaps that functionality should also be put in an independent class (like #505) too.
Try to replace the polling and excessive MutationObserver usage in delite/popup.
Currently it uses polling to check if:
It also uses MutationObserver to check if the popup changed size due to DOM nodes being added/removed, classes changed, etc.
While we still need to use MutationObserver to detect if the popup's class has changed, we can use #505 to detect if the size has changed.
As for scrolling, we can detect scrolling on the viewport or a nested element via:
We can even check whether the
evt.target
is an ancestor of the anchor node or not. Perhaps that functionality should also be put in an independent class (like #505) too.