Problem with ons.GestureDetector / onmousedown
Maenny last edited by
I am working on an little App with OnsenUI and want to implement a hold-interaction on a dynamically generated div. If possible, I don’t want to dynamically register & destroy multiple event-Handlers, but would rather have something in the style of the onclick-property:
<div id="something" onclick="myFunction()"></div>
<div id="something" onmousedown="startTimer()" onmouseup="stopTimer()"></div>
This should work, but I noticed some strange behaviour I can’t explain: The oonmousedown and onmouseup event are only triggered when I do a normal click on the div. If I press down and hold, the events ARE NOT fired. I do have a ons-ripple element insied the div, but even without this, the onmousedown is not triggered when I hold the mousebutton.
Is this something related to OnsenUI? Does Onsen somehow redirect clicks? Or is this another problem I do not see?
thanks in advance for any response!