Button onclick does not fire on first click

4 posts, 0 answers
  1. Brian
    Brian avatar
    8 posts
    Member since:
    Dec 2012

    Posted 27 Dec 2012 Link to this post

    I have a button in my HTML with an onclick event.  It is not firing on the first try.  I tried to add an alert(); to the onclick to see if the issue was the event firing or my code and it turns out, it is the event firing.  Code for the button is below.  Thoughts on how to fix it?  The issue is not happening in Graphite or Mist.

    <input type="button" onclick="Pendings.addAccount();" value="submit"/>
  2. Brian
    Brian avatar
    8 posts
    Member since:
    Dec 2012

    Posted 27 Dec 2012 Link to this post

    <a data-role="button" onclick="Pendings.addAccount();">Submit</a>

    The above has the same issue.
  3. Brian
    Brian avatar
    8 posts
    Member since:
    Dec 2012

    Posted 27 Dec 2012 Link to this post

    Turns out it is an Apple thing.  use onTouchStart or onTouchEnd.  Otherwise, you are subject to a 300ms delay that any other touch will interrupt.  It is compensating for gestures.
  4. Jordan
    Admin
    Jordan avatar
    197 posts

    Posted 28 Dec 2012 Link to this post

    Hello,

    yes it is a known issue and it has relation to the zoom and scrolling as well.
    Depending on your project it may be worth checking some mobile frameworks as jQuery Mobile, Kendo UI Mobile etc. as they provide a workarounds for this and many other mobile challenges and give the HTML applications more native look and feel.

    Happy holidays,
    Jordan
    the Telerik team

    Share feedback and vote for features on our Feedback Portal.
    Want some Kendo UI online training - head over to Pluralsight.
Back to Top