UNPKG

@adyen/adyen-web

Version:

[![npm](https://img.shields.io/npm/v/@adyen/adyen-web.svg)](https://www.npmjs.com/package/@adyen/adyen-web)

3 lines (2 loc) 377 B
const o=o=>{const t=o.parentNode,e=window.getComputedStyle(t,null),p=parseInt(e.getPropertyValue("border-top-width")),l=o.offsetTop-t.offsetTop<t.scrollTop,f=o.offsetTop-t.offsetTop+o.clientHeight-p>t.scrollTop+t.clientHeight;(l||f)&&(t.scrollTop=o.offsetTop-t.offsetTop-t.clientHeight/2-p+o.clientHeight/2)};export{o as simulateFocusScroll}; //# sourceMappingURL=utils.js.map