El "gesto" que trato de capturar es un toque cuando, pero solo cuando un elemento (otro o igual) ya tiene un toque en él. Por lo tanto, toque (1) presiona el botón hacia abajo mientras toca (2) toca las opciones seleccionadas, toca (1) versiones y se presiona el botón.Mobile Safari: evento "touchend" que no se activa cuando se elimina el último toque?
El problema que estoy teniendo es el último. El evento "touchend" no se dispara cuando suelto el último dedo? Entonces, ¿no tengo forma de presionar el botón?
.. también el evento "touchend" siempre tiene touches.length = 0?
Aquí hay un código para que pueda ver lo que quiero decir. Creo que esto puede ser un error en el safari móvil?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Multi-touch problem</title>
<style>
#touchpane{
width:900px;
height:500px;
background-color:#333;
}
</style>
</head>
<body>
<div id="touchpane" click="void();"></div>
<script>
var tp = document.getElementById("touchpane");
tp.addEventListener('touchstart', function(e){
e.preventDefault();// to stop copy and paste
console.log("touchstart " + e.touches.length);
}, false)
tp.addEventListener('touchend', function(e){
console.log("touchend " + e.touches.length);
// not called when last finger removed?
}, false)
tp.addEventListener('touchcancel', function(e){
console.log("touchcancel");
}, false)
</script>
</body>
</html>
Asegúrese de incluir su versión del sistema operativo. Esto funciona como esperaba en 3.1.3 (iPod touch de primera generación): "touchstart 1", "touchstart 2", "touchend 1", "touchend 0". –
Por supuesto, lo siento. 3.2.1 en el iPad. Este y algunos otros parecen haber sido corregidos en 4.2 –