React-sortable-hoc: react-sortable not working on IE11

Created on 5 Jul 2017  ·  8Comments  ·  Source: clauderic/react-sortable-hoc

Hi,

I need to use react-virtualized with drag and drop supported, but I can't make the demo of react-sortable work on IE11. Drag and drop is just not enabled on the demo using IE11.

Is it possible to use react-sortable on IE11 ?

Thanks for help.

Regards,

MS

Most helpful comment

This should be fixed in 0.6.6, thanks @humiston 😄

All 8 comments

I've actually just looked into this issue as I needed support for IE 11 myself as well. I'm currently using the commonjs SortableContainer, so this fix may not be exact compared to ES6 and UMD.

Quickly looking in SortableContainer/index.js, both updatePosition and animateNodes functions rely on window.scrollY, window.scrollX, this.initialWindowScroll.top, and this.initialWindowScroll.left to calculate adjustment for window scroll. Unfortunately, all of these values appear to be NaN when using IE 11. Doing some quick research, a good alternative seems to be window.pageYOffset and window.pageXOffset.

As a temporary fix, I am using the following in SortableContainer/index.js:

updatePosition

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

animateNodes

var scrollDifference = {
  top: (window.scrollY - this.initialWindowScroll.top) || window.pageYOffset,
  left: (window.scrollX - this.initialWindowScroll.left) || window.pageXOffset
};

Testing this with scroll appears to work and still feels extremely smooth.

I am also having this problem. It appears that 0.6.5 has broken IE 11. I have rolled back to 0.6.3

confirming that 0.6.5 broke IE11, it also works fine on 0.6.4

248 has the fix related to this issue.

Nice, I hope it gets merged soon 👍

@clauderic Have you had a chance to look at this. Not working on IE11 for me, either. Thanks!

@mccambridge I have a possible bug fix in pr #248 that @clauderic is in the process of reviewing. Unfortunately, I'm not sure when he will be free again to review my latest changes. Hopefully it is soon.

This should be fixed in 0.6.6, thanks @humiston 😄

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sami616 picture sami616  ·  4Comments

zaygraveyard picture zaygraveyard  ·  3Comments

ncammarata picture ncammarata  ·  4Comments

sammiwei911 picture sammiwei911  ·  3Comments

zhujunwei picture zhujunwei  ·  3Comments