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

UIDragger emits onClick with onDrop #66

Closed
tibotiber opened this issue Jun 19, 2019 · 3 comments · Fixed by #67
Closed

UIDragger emits onClick with onDrop #66

tibotiber opened this issue Jun 19, 2019 · 3 comments · Fixed by #67

Comments

@tibotiber
Copy link
Contributor

A bit of a follow up to #63.

UIDragger emits both onClick and onDrop when uidrop happens. This is because uidrop comes from the space's up event (UI.ts#L449) which emits onClick (UI.ts#L361). This can be managed in user land (that's what I do so far), but there may be an opportunity for a better behaviour. What are your thoughts on this?

If interested, I can have a go at starting a PR.

@williamngan
Copy link
Owner

I see. That is a problem. If I understand correctly, should the fix looks like this:

  • if dragging happened, only emits 'uidrop'
  • if no dragging, only emits 'up'

Agreed that would be a better behavior. If you can start a PR, that would be super helpful!

@tibotiber
Copy link
Contributor Author

Yes, agreed with the expected behaviour. The only issue is that up is emitted after dragging, when there is no dragging uidrop is not emitted.

I'll have a go at this and open a PR. Probably after #65 is merged to avoid conflicts.

@williamngan
Copy link
Owner

Thanks! I merged #65.

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

Successfully merging a pull request may close this issue.

2 participants