Skip to content

Accordion onmouseup change events guaranteed to not fire #96

@thezboe

Description

@thezboe

_onDocMouseUp() {
const Mx = this.Mx;
// We are no longer dragging
this.dragging = false;
this.edge_dragging = false;
// only emit an event if we are actually dragging
if (!this.dragging || !this.edge_dragging) {
return;
}
// Issue a slider tag event
let evt = document.createEvent('Event');
evt.initEvent('accordiontag', true, true);
evt.center = this.properties.center;
evt.width = this.properties.width;
mx.dispatchEvent(Mx, evt);
this.emit('change', {
center: this.properties.center,
width: this.properties.width
});
}

this.dragging and this.edge_dragging are set to false just before the if-statement that returns if one of them is false.
Furthermore, I believe the if-statement logic is incorrect. this.dragging is set to true if the center is being dragged, and this.edge_dragging is true if the edge is being dragged. They are never both true at the same time it appears, so the if-statement will always be truthy and the event never fired.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions