@shopify/polaris
Version:
Shopify’s admin product component library
17 lines (13 loc) • 351 B
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
function scrollIntoView(element, container) {
requestAnimationFrame(() => {
if (element) {
const offset = element.offsetTop - container.scrollTop;
container.scrollBy({
top: offset
});
}
});
}
exports.scrollIntoView = scrollIntoView;