jeudi 31 décembre 2015

How to know if a 'click' event was actually the user trying to highlight some text?

I have a list of items, when clicked, fires an event which hides the clicked item. However, there's text within the item, which the users sometimes try to highlight, in order to copy the text. But the event fires when they finish highlighting, thus, hiding the text they wanted to copy. I still want the event to fire if the user actually clicks on the text, but not if they click-hold and highlight.

Is it possible to differentiate this in jQuery? Bonus, my website is on Ember.js, if you happen to know that it's achievable using Ember's action helper, let me know!

Thanks!




Aucun commentaire:

Enregistrer un commentaire