nwjs / nw.js

Call all Node.js modules directly from DOM/WebWorker and enable a new way of writing applications with all Web technologies.
https://nwjs.io
MIT License
40.39k stars 3.88k forks source link

Code that uses interact.js no longer works in nwjs 0.18 but works in Chrome #5467

Closed mauvilsa closed 7 years ago

mauvilsa commented 8 years ago

I have some code that has stopped working since nwjs 0.18. The problem can be observed with the SVG example from http://interactjs.io/. It is a star in SVG whose corners can be dragged to change its shape. Here I share the code to reproduce it: nwjs_star_interact.zip

In tests I have done, it works correctly in:

This example no longer works in nwjs >= 0.18 (tested both in OS X and Ubuntu), even though the chromium used is almost the same version (54.0.2840.99 for nwjs 0.18.6). I expected that code that works in Chrome would also work in nwjs, so I create this issue in case it may be related to a possible bug in new releases of nwjs.

rogerwang commented 8 years ago

The difference is that it executes the code path in line 1328 of interact.js in browser, while in line 1323 in NW. If line 1322 is replaced with 'if (false) {' then things work well.

It seems that interact.js tries to detect whether it's running in browser or Node. So it gets confused in NW. This is similar situation with #5429 .

And it may works in 0.17.6 because of lacking support of pointer events I think.

mauvilsa commented 8 years ago

I have changed the title of the issue so that interact.js gets mentioned. This way if other people observing this problem are able to find this better. I have also created interact issue 447.

The problem does seem to be related with the pointer events. Thank you!

Christywl commented 7 years ago

I can't reproduce this issue on Linux and Mac with nwjs-sdk-v0.21.2. All the corners of the star can be dragged to change its shape. @mauvilsa , could you please check in your environment again?

mauvilsa commented 7 years ago

The nwjs_star_interact.zip that I created back then works correctly for me with nwjs-sdk-v0.21.2 in Mac. However, if I replace the interact.js file with the stable version (1.2.6) available at http://interactjs.io, it does fail. I have updated nwjs_star_interact.zip including interact 1.2.6, so that the problem can be reproduced with the latest versions of nwjs. Anyway, I think this issue has been fixed, https://github.com/taye/interact.js/issues/457 .

rogerwang commented 7 years ago

close as it's a fixed issue in interact.js