Skip to content
This repository has been archived by the owner on Nov 16, 2021. It is now read-only.

clickOutside- differentiating drag from click #66

Closed
vinayakbkulkarni opened this issue Aug 12, 2020 · 6 comments
Closed

clickOutside- differentiating drag from click #66

vinayakbkulkarni opened this issue Aug 12, 2020 · 6 comments

Comments

@vinayakbkulkarni
Copy link

The default behaviour shows click & drag to outside both trigger callback registered with clickOutside.
I need the event to be triggered only on click & not drag. How to achieve this

@arkon
Copy link
Owner

arkon commented Aug 12, 2020

This is similar to #49. You can maybe adjust which events are listened to instead?

@vinayakbkulkarni
Copy link
Author

works well thanks. Added below suggested code
[clickOutsideEvents]="'mousedown'"

@vinayakbkulkarni
Copy link
Author

vinayakbkulkarni commented Aug 12, 2020

but this now requires 2 clicks to get the clickOutside event. Is there any better approach which will make single click outside work.

@arkon
Copy link
Owner

arkon commented Aug 12, 2020

No, this is just the browser's behaviour.

@vinayakbkulkarni
Copy link
Author

I was just checking Gmail search dropdown which worked well. Is there any suggestion or alternate approach to adapt.

@arkon
Copy link
Owner

arkon commented Aug 12, 2020

You can read the source code to get a better idea of what it's doing, but it's very basic usage of click handlers and checking what the target was.

If you have a better idea, feel free to suggest it.

@arkon arkon closed this as completed Aug 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants