Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addressing issue #58 - useWindowAsScrollContainer bug #198

Closed
wants to merge 2 commits into from

Conversation

Jwhiles
Copy link

@Jwhiles Jwhiles commented Apr 28, 2017

Currently useWindowAsScrollContainer doesn't work in firefox and internet explorer

  • I've added a function that checks whether the scroll top property is present on document.documentElement or document.documentBody. I think the code is slightly messy, but probably preferable to inlining an if statement into the existing ternary operator.

This works in Firefox - I'm not sure whether this also resolves the issue for internet explorer. I will try and determine and get access to a windows machine and test over the weekend.

@@ -105,12 +105,18 @@ export default function sortableContainer(WrappedComponent, config = {withRef: f
useWindowAsScrollContainer,
} = this.props;

const findScrollTop = () => {
if (this.document.body['scrollTop']) { return this.document.body; }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about:
if('scrollTop' in this.document.body)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, please note that in Chrome scrollTop is present in both but appears to be writeable ONLY in document.documentElement but not in document.body

@clauderic
Copy link
Owner

Closed in favour of #306

@clauderic clauderic closed this May 17, 2018
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