Open eirikurn opened 8 years ago
A workaround is set pointer-events: none;
on the svg element.
Hrm im not sure if we should actually do something here or just document this
Yeah, only "fix" I can think of now is:
var node = e.target;
while (node && !node.click) {
node = node.parentNode;
}
if (node) node.click();
@eirikurn pretty much but the css solution is a lot nicer but far less automatic
Am facing this on android browsers – however I'm thinking the dropHammer
function should just be wrapped in a check for target.click
. This way the default functionality is preserved should hammer-time not be able to fire:
dropHammer: function( e ) {
if ( e.target.click ) {
if ( e.type === "touchend") {
e.target.focus();
// Wait for next tic so events fire in proper order
setTimeout( function() {
e.target.click();
}, 0 );
}
// Prevent the click which will come after this otherwise but with a 300ms delay
e.preventDefault();
}
},
I think this is preferable than making assumptions about clicking through to the parent?
I am also experiencing this on an iPad. The pointer-events: none
thing fixed it, but I also feel that this shouldn't break, but just fall back to 'regular' behavior in that case.
This happens when the target of the touch events is a SVG element, e.g. a button/link that contains an SVG icon.
A JavaScript error occurs on
e.target.click()
, as svg elements don't have that method.