Skip to content

Align mouse events sequence with browsers which support native dnd #21320

Closed

Description

@rebornix

In Safari and Chrome, we can get following events when you click on a selection and dnd

mousedown
mousemove, mousemove ... (the number of mousemove events depend on how fast you move)
dragstart
drag, dragover
drag, dragenter, dragover
...
drag, dragover
drop
dragend

However right now, we are implementing our dnd by listening to mousedown and mouse up events, our emitted events are like

drag
mousedown
drop
drag
...
drag
mouseup
drop

Moreover, single click on a selection now emits redundant events

drag
mousedown
mouseup

This is because whenever users click on a selection, right now we think it's a drag event but if users release the mouse real quick (we get a mosueup event from browser before a mouse move event kicks in), we will treat it as a single click. But since we take it as drag at the beginning, we emit an unnecessary drag event.

Activity

  1. rebornix commented on Mar 29, 2017

    @rebornix
    ContributorAuthor

    The sequence is already sane.

  2. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions