Hi there,
we’ve been experiencing issues with button and links that will simply not work or only sometimes in Safari mobile (iPhone). I’ve tested with iPhone 5, iPhone 6 and even iPhone X - buttons will not fire when tapped on.
The issue is related to how Safari handles touch and click events, and you will find plenty of discussion and incomplete solutions: Event bubbling not functioning as expected, cursor needs to be pointer, onclick attribute needs to be set, etc.
My ugly workaround was to bind the touchend
event to every clickable element to trigger the click()
function:
/* very hacky addition of touchend event for mobile Safari */
if ( /^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
var clickableElements = ".x-anchor-toggle, button, .x-anchor-button, li.menu-item, input.submit, .x-scroll-top";
jQuery(clickableElements).attr("style", "cursor: pointer;");
jQuery(clickableElements).bind( "touchend", function(e) {
jQuery(this).trigger("click");
});
}
The site is https://zahnarzt-helden.de.
Can you investigate and provide some more tips?
Thanks!