export function scrollIntoView(index, element) {
  if (!element.parentElement) {
    return;
  }
  if (index === 0) {
    element.parentElement.scrollTop = 0;
    return;
  }
  var offsetTop = element.offsetTop,
    clientHeight = element.clientHeight;
  var _element$parentElemen = element.parentElement,
    scrollTop = _element$parentElemen.scrollTop,
    parentHeight = _element$parentElemen.clientHeight;
  if (offsetTop < scrollTop) {
    element.parentElement.scrollTop = offsetTop;
  } else if (offsetTop + clientHeight > scrollTop + parentHeight) {
    element.parentElement.scrollTop = offsetTop - parentHeight + clientHeight;
  }
}
//# sourceMappingURL=scrollIntoView.js.map