W3C home > Mailing lists > Public > public-pointer-events@w3.org > April to June 2017

Re: [pointerevents] Pointer capture should prevent HTML drag+drop (DnD)

From: Navid Zolghadr via GitHub <sysbot+gh@w3.org>
Date: Mon, 26 Jun 2017 17:27:30 +0000
To: public-pointer-events@w3.org
Message-ID: <issue_comment.created-311126652-1498498049-sysbot+gh@w3.org>
> I definitely hear the arguments for simplicity and consistency with existing APIs. There's a counterargument for explicitness and obviousness: I don't think I've ever seen HTML5 drag-and-drop used in a touch UI. Gestural interaction is the natural modality of touch UI. Favoring drag-and-drop at the expense of pointer events makes the common case harder to get right in order to support a feature (touch-based drag-and-drop) that isn't being used in practice.

Can you go over the simple use case once again so we can focus on that part of the problem rather than introducing edge cases?

> Explicitly captured pointers (e.g. by element.setPointerCapture) don't participate in HTML drag-and-drop: pointer{down,move,up} dispatch as if dragging doesn't exist, and dragstart et. al. never happen.

You are now differentiating between explicit and implicit capture which we wanted to indeed avoid. Now just getting `gotpointercapture` might mean either implicit or explicit which makes the prediction of the behavior that much harder.

> Explicitly draggable elements dispatch pointercancel & lostpointercapture immediately before dragstart. Calling downEvent.preventDefault() overrides this by preventing dragstart from ever happening.

This whole drag action and how it starts is not spec'ed yet as far as I know. So this is a browser behavior and vendor specific. So it is not necessary only in this case. I'm more in favor of disabling drag beforehand declaratively similar to touch-action for scrolling so that browser can decide whether it wants to take over the input or not and if it does consume the input stream it just sends the `pointercancel` in all the cases no exception.




-- 
GitHub Notification of comment by NavidZ
Please view or discuss this issue at https://github.com/w3c/pointerevents/issues/205#issuecomment-311126652 using your GitHub account
Received on Monday, 26 June 2017 17:27:38 UTC

This archive was generated by hypermail 2.3.1 : Monday, 26 June 2017 17:27:39 UTC