This event seems to be missing from the standard events. Lick click, I would need to set up a listener for it in a component.
Asked
Active
Viewed 539 times
1
-
This should be helpful https://stackoverflow.com/questions/5497073/how-to-differentiate-single-click-event-and-double-click-event – Piotr Adam Milewski Feb 21 '19 at 10:13
2 Answers
0
Thanks to Piotr for getting me on the right track. As of this post, there is no double click event for aframe, but we can use js/jquery to get around this. Here is the start of my function:
el.addEventListener('click', function(evt) {
\$('#myEmbeddedSce').on('dblclick', function(event) {
event.stopPropagation();
event.stopImmediatePropagation();
..... The key was to add the jquery listener inside the aframe listener, and add the stop propagations so the doubleclicks only registered once.
Bo Bennett
- 13
- 4
0
use stopPropagation() to detect the double click in the frame.
The stopPropagation() method prevents propagation of the same event from being called. Propagation means bubbling up to parent elements or capturing down to child elements.
Syntax
event.stopPropagation()
Hemant
- 141
- 2
- 10