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

IE 11 fixes for react-sortable-hoc #248

Merged
merged 4 commits into from
Jul 26, 2017
Merged

Conversation

humiston
Copy link
Contributor

Added window.pageYOffset and window.pageXOffset to updatePosition and animateNode to allow proper drag and drop animation for Internet Explorer 11

Copy link
Owner

@clauderic clauderic left a comment

Choose a reason for hiding this comment

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

Hey @humiston, thanks for taking the time to submit this!

I think there might be an oversight in the code though, I don't think your proposed solution would work the same as the existing code.

Would you mind updating your PR to address this feedback? 😄

translate.y -= (window.scrollY - this.initialWindowScroll.top);
translate.x -= (window.scrollX - this.initialWindowScroll.left);
translate.y -= (window.scrollY - this.initialWindowScroll.top) || window.pageYOffset;
translate.x -= (window.scrollX - this.initialWindowScroll.left) || window.pageXOffset;
Copy link
Owner

Choose a reason for hiding this comment

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

Looks to me like those two statements are not equivalent.

The first one will take into account the diff between the current scrollY and scrollX values vs the initial scroll value

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated this pr with the correct assignment of our initial scroll values so our diff is accurate when using IE 11.

humiston and others added 3 commits July 20, 2017 14:22
…rmine the diff between the initial and current scroll values
All of the browsers that support scrollX/Y already support pageXOffset and pageYOffset
@clauderic clauderic merged commit f6f56a6 into clauderic:master Jul 26, 2017
@clauderic
Copy link
Owner

Just published 0.6.6 with this fix, thanks again for your contribution 😄

@mccambridge
Copy link

@clauderic @humiston I'm running storybook with this fix, and I still see the issue with IE11. Both in my code and in your Drag Handle storybook example. Items aren't draggable at all.

@timothyallan
Copy link

timothyallan commented Jul 28, 2017

It's because IE11 doesn't support Array.From() which is being used in the code. I just ran into this myself.

Edit: Using a polyfill fixed it, but then you're using a polyfill 😬
https://www.npmjs.com/package/array-from

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.

4 participants