Skip to content

Conversation

@stonys
Copy link

@stonys stonys commented Sep 11, 2017

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.

@stonys
Copy link
Author

stonys commented Sep 11, 2017

I didn't create a minified version, if you accept my PR, you could point the tool used for bundling.

@danallen88
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants