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

Accordion onmouseup change events guaranteed to not fire #96

Open
thezboe opened this issue Oct 6, 2020 · 4 comments
Open

Accordion onmouseup change events guaranteed to not fire #96

thezboe opened this issue Oct 6, 2020 · 4 comments

Comments

@thezboe
Copy link
Contributor

thezboe commented Oct 6, 2020

_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.

@maihde
Copy link
Contributor

maihde commented Oct 7, 2020 via email

@thezboe thezboe closed this as completed Oct 7, 2020
@thezboe thezboe reopened this Oct 7, 2020
maihde added a commit to spectriclabs/sigplot that referenced this issue May 22, 2021
@maihde
Copy link
Contributor

maihde commented May 22, 2021

@thezboe I fixed this in spectriclabs@4b58015

@thezboe
Copy link
Contributor Author

thezboe commented Jun 15, 2023

This has caused another issue with accordion events. I believe the following snippet needs to be && not || since they will never both be true. This has the result that the accordion plugin can not be dropped.

if (!this.dragging || !this.edge_dragging) {

@maihde
Copy link
Contributor

maihde commented Jun 16, 2023

Thanks Zach we will take a look. FYI the primary source for SigPlot has been moved to https://github.com/spectriclabs/sigplot so I recommend placing any future issues there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants