polymer
polymer copied to clipboard
Click handlers don't work anymore on iOS with 0.5.0
I'm seeing strange behaviour with click handlers on Mobile Safari (iOS 8.1). With the example below only the first button triggers the alert. The other three elements (2 a's and the second button) don't trigger anything: the first a doesn't even open the website. Tested this with 0.5.0. With 0.4.2 everything works ok.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--load the polyfill-->
<script src="bower_components/webcomponentsjs/webcomponents.js"></script>
<link rel="import" href="bower_components/polymer/polymer.html"></script>
<polymer-element name="my-element">
<template>
<button onclick="alert('button clicked')">Click me</button>
<button on-click="{{clickHandler}}">Click me</button>
<a href="http://www.google.com">Google</a>
<a on-click="{{clickHandler}}">Polymer click handler</a>
</template>
<script>
Polymer({
clickHandler : function(event, detail, sender) {
alert('Polymer click handler');
}
});
</script>
</polymer-element>
</head>
<body>
<my-element></my-element>
</body>
</html>
Note that a result of this is that the Polymer project site is broken on iOS (in Chrome as well as Safari).
This is a known issue that we're hot fixing today. 0.5.1 will be out soon.
Should be fixed in 0.5.1