src/utils.js
function scrollIntoView(node, menuNode) {
  if (node === null) {
    return
  }

  const actions = computeScrollIntoView(node, {
    boundary: menuNode,
    block: 'nearest',
    scrollMode: 'if-needed',
  })
  actions.forEach(({el, top, left}) => {
    el.scrollTop = top
    el.scrollLeft = left
  })
}
function scrollIntoView(node, menuNode) {
  if (node === null) {
    return
  }

  const actions = computeScrollIntoView(node, {
    boundary: menuNode,
    block: 'nearest',
    scrollMode: 'if-needed',
  })
  actions.forEach(({el, top, left}) => {
    el.scrollTop = top
    el.scrollLeft = left
  })
}
function scrollIntoView ( node , menuNode ) { if ( node === null ) { return } const actions = computeScrollIntoView ( node , { boundary : menuNode , block : 'nearest' , scrollMode : 'if-needed' , } ) actions . forEach ( ( { el , top , left } ) => { el . scrollTop = top el . scrollLeft = left } ) }
Scroll node into view if necessary
@param {HTMLElement} node the element that should scroll into view
@param {HTMLElement} menuNode the menu element of the component
Scroll node into view if necessary