Open stonys opened 7 years ago
I didn't create a minified version, if you accept my PR, you could point the tool used for bundling.
Any reason we can't go ahead with merging this in? As it stands, the library doesn't work with custom containers without this fix. If your element.offsetParent
is anything but the scroll container, you end up needing this along with setting the scroll container to have either absolute or relative positioning to make the scroll container the offsetParent, and then stopping since that's the container. Otherwise this just keeps going up the hierarchy until offsetParent becomes null, which isn't desirable since the container should be the top-level element to consider in this situation.
If custom container if provided, the value of
location
is calculated incorrectly. Loop goes up to root element and adds up all offsetTop values. It should stop at the container provided and do not include parent element offsetTop values.