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

When to continue firing pointer events after a drag operation? #222

Closed
mingchou opened this issue Oct 3, 2017 · 5 comments
Closed

When to continue firing pointer events after a drag operation? #222

mingchou opened this issue Oct 3, 2017 · 5 comments
Labels

Comments

@mingchou
Copy link

mingchou commented Oct 3, 2017

Follow #194, spec says UA must fire pointercancel immediately before drag operation starts. Spec also says UA must also fire pointerout and pointerleave after pointercancel. But spec doesn't mention when to continue firing pointerevents (e.g. after drag operation ends or something).

Tested with hoverable device, Chrome and Edge continue firing pointer events when the drag operation ends. But Chrome fires boundary events (pointerout, pointerleave, pointerover, pointerenter) when the drag operation ends, while Edge fires pointerout, pointerleave when drag operation starts and pointerover, pointerenter when drag operation ends.

@mingchou
Copy link
Author

I'm going to implement the behavior of firing pointercancel immediately before drag operation starts for Firefox. But I'm blocked by this question about when to continue firing pointer events and what are the expected boundary events. Wondering whether Edge or Chrome's behavior is expected?

@mingchou
Copy link
Author

mingchou commented Nov 3, 2017

spec says "From the moment that the user agent is to initiate the drag-and-drop operation, until the end of the drag-and-drop operation, device input events (e.g., mouse and keyboard events) must be suppressed." This answers my first question about when to continue firing pointer events.

Regarding boundary events, Edge fires boundary events after dragstart but Chrome doesn't. Spec says "After firing the pointercancel event, a user agent MUST also fire a pointer event named pointerout followed by firing a pointer event named pointerleave."

@NavidZ
Copy link
Member

NavidZ commented Nov 3, 2017

Sorry. I missed this one too before. Alright. You are right. We recently started sending pointercancel after drag operation starts and I intentionally for the first round didn't send the boundary events. We already hit some regressions in some js library by sending pointercancel when mouse starts dragging and we send pointercancel for it. But now we solved them and didn't hear anything else so far.
Regarding the boundary events I believe we adhere to the spec and send the leave/out right after pointercancel. If Edge does that this is correct and as you said Chrome doesn't do that which is no spec compliant. btw, does Edge send pointercancel when dragstarts for the mouse? I didn't know they added that then. If so bravo to them :)

Regarding the other question of when to start sending pointerevents again, spec never mentioned the same thing for scrolling case (which also caused pointercancel) either. So I'm not how to exactly include that in the spec to preferably cover all the cases. Do you have any suggestion?

@mingchou
Copy link
Author

mingchou commented Nov 3, 2017

Edge doesn't fire pointercancel. It fires dragstart, pointerout, and pointerleave.

Since the spec already defines that input events must be suppressed when starting a dnd operation until it is finished. I think the behaviour is clear to me. But if we can have a link to that, it will be very helpful when reading the pointer event spec.

@NavidZ
Copy link
Member

NavidZ commented Mar 14, 2018

We talked about this in the call and we agreed since we don't specify when to continue sending events in scroll we leave this scenario to UA as well similar to scroll.

@NavidZ NavidZ closed this as completed Mar 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants