I have a simple rectangular anchor tag. I used jQuery to respond to click
and touchstart
events with the following:
$(document).ready(function() {
$("#button").on("click touchstart", function(e) {
$("#log").append(e.type + "<br/>");
});
});
The HTML looks like this:
<div id="wrapper">
<a id="button" href="#"> </a>
</div>
<div id="log">Log:<br></div>
The CSS is simple:
#wrapper {
padding:50px;
}
#button {
display:block;
width:200px;
height:40px;
text-decoration:none;
color:#333;
background-color:#efefef;
border:0px;
padding:0px;
margin:0px;
}
I built this as a demo to show the problem I'm talking about.
When you tap the edge of the rectangular anchor, only the click
event is fired. When you tap the center of the area, both click
and touchstart
are fired.
Why is it that only click
seems to be triggered with the fat-finger detection? Is there a way to make the touchstart
event also work with fat fingers?