UNPKG

@shopify/polaris

Version:

Shopify’s admin product component library

13 lines (11 loc) 258 B
function scrollIntoView(element, container) { requestAnimationFrame(() => { if (element) { const offset = element.offsetTop - container.scrollTop; container.scrollBy({ top: offset }); } }); } export { scrollIntoView };