( node: HTMLElement | undefined, menuNode: HTMLElement | undefined, )
| 6 | * @param {HTMLElement} menuNode the menu element of the component |
| 7 | */ |
| 8 | export function scrollIntoView( |
| 9 | node: HTMLElement | undefined, |
| 10 | menuNode: HTMLElement | undefined, |
| 11 | ) { |
| 12 | if (!node) { |
| 13 | return |
| 14 | } |
| 15 | |
| 16 | const actions = compute(node, { |
| 17 | boundary: menuNode, |
| 18 | block: 'nearest', |
| 19 | scrollMode: 'if-needed', |
| 20 | }) |
| 21 | actions.forEach(({el, top, left}) => { |
| 22 | el.scrollTop = top |
| 23 | el.scrollLeft = left |
| 24 | }) |
| 25 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…