Open jeffderek opened 2 years ago
Its a good idea. What tag name do you propose and how will it work on mobile and desktop?
It depends on how backwards compatible you want to be, really. So there are two different classes I think you want.
Name options for item 2 would be v-press-class or v-click-class. Both of those make sense to me now, but it's not very intuitive without the docs what the difference between v-touch-class and v-click-class is. Users likely would have to consult the docs each time.
Another approach entirely would be three classes.
Then if you wanted touch and hover, you could just have the same class get added for both of those, or if you wanted touch and click you could have the same class get added for both of those. This is a lot easier to handle naming, because you have v-touch-class, v-click-class, and v-hover-class. On the other hand it's not very backwards compatible because now v-touch-class would no longer do stuff that it used to do.
On a lot of touch devices, adding a class for touch feedback is much more responsive than using the css :active selector, so I prefer to use that approach when possible. v-touch-class works great for that, but for projects that will be used on both mobile and desktop, I want it to behave as a click on desktop and not as a hover. Basically just looking for a version of v-touch-class that doesn't use the mouseenter and mouseleave events.