-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
dd-gestures inclusion makes DD.Drag select page text during the drag action #693
Comments
@opichals This is the fix I would recommend. I recently had the same issue with a separate drag and drop library I'm working on, and this was the solution. |
It's just that the dd-ddm::_move method does not always call preventDefault() while this patch would prevent it for every occurrence. |
Also our QA found the suggested solution doesn't work in FF 20. So I opted to to roll my dd-* modules back to version 3.7.1 which we upgraded from. This seems to be working as expected so far. So in my eyes the http://yuilibrary.com/projects/yui3/ticket/2532718 bugfix introduced quite a nontrivial regression. |
Hi all, We're seeing this issue. What's the chance of it getting some kind of fix integrated for this? @opichals, what issues were you seeing on FF20? |
Pull request submitted in #1557 |
@andrewnicols @rgrove @opichals The proposed fix that we merged in breaks page scrolling due to the You can see this by going to http://yuilibrary.com/yui/docs/dd/groups-drag.html on a touch-enabled device and trying to scroll the page. I agree that we need the |
@clarle and I were thinking that instead of using Here's how it can work:
This way, you don't need I came up with a very rough proof of concept to test if this would work. I basically changed the Y.one(Y.config.doc).on("gesturemove", function (e) {
DDM._move(e);
e.currentTarget.setStyles({
"-khtml-user-select": "none",
"-moz-user-select": "none",
"-ms-user-select": "none",
"user-select": "none",
"-webkit-touch-callout": "none",
"-webkit-user-select": "none"
});
}, {standAlone: true}); Again, we wouldn't want to set styles on |
For reference, this is the original issue we had reported: https://tracker.moodle.org/browse/MDL-42409 I've just installed the android sdk and used avd to replicate on a generic tablet. Before the first patch, drag/drop is completely unreliable; afterwards it seems to work well. However, the stock Android browser is now blocked from other touch events - e.g. using gestures to move the page. I've put a video up at https://www.youtube.com/watch?v=yc-MhA4g9v0 showing:
Suffie to say, none of the above performs well at all (not even jQuery). |
Thanks @andrewnicols the video helps. So looks like we have two problems:
I'll look into it to see what else we can do. I have an Android tablet that I can test on, so maybe my results will vary. |
Android browsers require that we prevent the default browser action on the start of drag. We tried this in yui#693/yui#1557, but this broke in other ways for other browsers. The issue stems from preventDefault being called on the document instead of the Node. This commit moves the preventDefault to the gesturemovestart in the prototype for DD.Drag.
I believe the issue came in http://yuilibrary.com/projects/yui3/ticket/2532718 bugfix. The fix moves the preventDefault handling from 'mousedown' to 'mousemove' to enable click handling on DD.Drag instances. However the mousemove handler calls DDM._move via Y.throttle and therefore selection and other DOM default actions are handled in the throttled-out occurences.
I have worked around that using the following patch, but I am not sure that would not cause other side-effects in other D&D use-cases. Please review.
The text was updated successfully, but these errors were encountered: