title: How to implement dblclick event on iPad
body: <p>I have a marquee planner that I've created for a client, and it basically consists of marquees and furniture that can be clicked and will be placed on a canvas to be dragged around. My major issue was getting it working correctly on touch devices, specifically iPad, and I got around the dragging by using touch punch, but the one thing I cannot get to work is the double click which is required to remove the element from the canvas.</p>
  
  <p>Here is the planner: <a href="https://southwestmarquees.co.uk/newsite/marquee-planner/" rel="nofollow noreferrer">https://southwestmarquees.co.uk/newsite/marquee-planner/</a></p>
  
  <p>If you open up the Furniture tab, click on a table and then double click that icon that appears it will remove it. The code I use is as follows:</p>
  
  <pre><code>$('.' + newItemClass).on('dblclick', function () {
      // remove any table planner data that may have been added.
      var existing_item_id = $(this).find('.add-guests').attr('data-item-id');
      $.ajax({
          type: "POST",
          url: "/newsite/wp-admin/admin-ajax.php",
          dataType: "json",
          data: {
              action: 'remove_table_planner_data',
              item_id: existing_item_id,
              plan_id: $('#plan-id').val()
          },
          success: function (response) {
              console.log(response);
          }
      });
  
      $(this).css('visibility', 'hidden');
  }); 
  </code></pre>
  
  <p>Just to explain, the action <code>remove_table_planner_data</code> just removes any existing data already saved for the table. I use visibility so that none of the other items already on the canvas are affected (I found that other elements jumped around if I used <code>remove()</code>)</p>
  
  <p>I tried implementing a suggestion made on <a href="http://appcropolis.com/blog/howto/implementing-doubletap-on-iphones-and-ipads/" rel="nofollow noreferrer">this page</a> and even though it recognises it as an iOS device, I cannot get the code to work when I double tap the screen.</p>
  
  <p>Any help on this is much appreciated as it's important that this planner works 100% correctly on iPad.</p>