How to let through my click event

I created a link and programmatically click it:

var a = document.createElement(“a”); = “mymap.png”;
a.href = canvasdata;

The above code block successfully fires a click normally, however it would be blocked by the ionic tap event handling system because of this function in ionic.bundle.js :

function tapClickGateKeeper(e) {
//console.log('click ’ + + ’ isIonicTap: ’ + (e.isIonicTap ? true : false));
if ( == ‘submit’ && e.detail === 0) {
// do not prevent click if it came from an “Enter” or “Go” keypress submit
return null;

// do not allow through any click events that were not created by ionic.tap
if ((ionic.scroll.isScrolling && ionic.tap.containsOrIsTextInput( ||
(!e.isIonicTap && !ionic.tap.requiresNativeClick( {

if (!ionic.tap.isLabelWithTextInput( {
  // labels clicks from native should not preventDefault othersize keyboard will not show on input focus
return false;


This function does not let through click event without isIonicTap set to be true. So my own click event created in Javascript is blocked as well here.

How can I let my click event go through?