Skip to content

dragEnd event not sent when single-clicking gutter #283

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

Closed
pweissenbacher opened this issue Dec 7, 2020 · 3 comments · Fixed by #284
Closed

dragEnd event not sent when single-clicking gutter #283

pweissenbacher opened this issue Dec 7, 2020 · 3 comments · Fixed by #284

Comments

@pweissenbacher
Copy link

Describe the bug
Package version: 4.0.0
When dragging the gutter, the events "dragStart/dragEnd" are working fine.
But when soley clicking the gutter, the dragStart event is fired, but the dragEnd event is not.

To Reproduce
Look at the small Stackblitz example (dragging not updating, but events fired as described)
StackBlitz Dev Mode
StackBlitz App Mode

@nomeaning777
Copy link
Contributor

In the current implementation, the component fires dragStart when a mouse button is pressed.
However, it fires dragEnd only when the mouse cursor is moved and the button is released.
If mouse cursor is not moved, it emits gutterClick/gutterDblClick.
https://github.com/angular-split/angular-split/blob/main/projects/angular-split/src/lib/component/split.component.ts#L709

I think it is better to fire dragStart event only when a mouse button is pressed and the cursor is moved.
I will be happy to create a PR if this breaking change is acceptable.

@beeman
Copy link
Collaborator

beeman commented Dec 8, 2020

@nomeaning777 I'm definitely interested in a PR that adds support for this (or maybe, fixes the bug that dragStart gets emitted when nothing gets dragged).

It would be awesome if it could be implemented with minimal amount of code changes, and add some cypress tests that prove the behavior.

I think we can publish that in a major version, maybe it can go into v5.

@beeman
Copy link
Collaborator

beeman commented Dec 18, 2020

This fix is released in version 5.0.0 thanks to @nomeaning777 🎉

https://stackblitz.com/edit/angular-ivy-xhc5bj?file=src/app/app.component.html

@angular-split angular-split locked and limited conversation to collaborators Feb 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants