简体   繁体   中英

Meteor template event Click not firing on iPhone

This Meteor template event failed to fire on iphone but works find on Android phone and desktop browsers. Any suggestion how to fix this? thx

Template.footer.events({
  'click .footerItem': function (event) {
    //do stuff
  }
});  
<template name="footer">
  <footer class="footer-row">
    {{#each footerButtons}}
        <div class="footerItem" data-action={{this.action}}>{{this.label}}</div>
    {{/each}}
  </footer>
</template>

This may seem like an odd answer but try adding the following css to the class 'footerItem':

.footerItem {
    cursor: pointer;
}

Why are you using the data-action={{this action}} ?
That is creating a conflict with the click event. Delete that part from your html and try again, the click should works on iPhone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM