It seems like long-press event is not part of the Polymer's specifications.
How would you implement that ?
I thought about using a behavior and using down
and up
event with some debounce
tricks to manage such a new event but that means I have to make a custom element to use this behavior and can't for example use it directly on any elements I want like :
<div on-long-press="_cheese">...</div>
which is not convenient.
Would you have other solutions ?
You don't have to make a custom element for this. This is what polymer behaviors are for. They provide a way for different polymer elements to share common behaviors.
As for the actual javascript for implementing the long-press you can get ideas from this question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With