Skip to content

'click' gets triggered when element is dropped (mouse only) #103

Description

@Samlibardi

How to reproduce:

  • Bind a click event to an element in a Slip list
  • Drag the element around
  • Drop it

This happens probably because the mousedown and mouseup events are triggered in the same position in the element.

So far, I've been able to work around this by adding the following:

this.target.node.addEventListener('click',function h(e) {
                            e.stopPropagation(); 
                            e.preventDefault(); 
                            this.removeEventListener(e.type,h,true);
                        },true);

in the onEnd method of the reorder state. This captures the click event and removes itself allowing it to be clicked (see #104 though). It feels very hacky and I don't know how well it behaves. It's been working fine for the time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions