getScrollParent = node => {
  let parent = node;
  while ((parent = parent.parentElement)) {
    const overflowYVal = getComputedStyle(parent, null).getPropertyValue("overflow-y");
    if (parent === document.body) return window;
    if (overflowYVal === "auto" || overflowYVal === "scroll") return parent;
  }
  return window;
}
MEMO: dropped based on https://caniuse.com/#search=resizeobserver.
TODO: The alternative would have been to conditionally load the ResizeObserver polyfill for browsers that don't support it.