Added flag to enable tap clicks for SVG in tested circumstances.

This commit is contained in:
2019-07-05 16:29:50 +02:00
parent f68d8b53a3
commit d0c89a78c2
4 changed files with 39 additions and 21 deletions
+8 -3
View File
@@ -6929,6 +6929,7 @@
height = null, // required
resizable = false,
clickOnTap = false,
triggerSVGClicks = false,
allowClickDistance = 44,
verbose = true,
onResize = null,
@@ -6981,6 +6982,7 @@
this.throwVisibility = Math.min(width, height, throwVisibility);
this.container = container;
this.clickOnTap = clickOnTap;
this.triggerSVGClicks = triggerSVGClicks;
this.scale = startScale;
this.rotationDegrees = this.startRotationDegrees;
this.transformOrigin = transformOrigin;
@@ -7037,9 +7039,11 @@
Therefore we make an exception and let the original click event through.
*/
if (event.target.ownerSVGElement) {
return
if (this.triggerSVGClicks) {
return
}
}
if (event.isTrusted) {
else if (event.isTrusted) {
Events$1.stop(event);
}
}, true);
@@ -7221,7 +7225,8 @@
if (nearestNode.tagName == 'svg') {
let handler = this.tapNodes.get(nearestNode);
console.log("Clicking beneath SVG: to be done", handler);
// nearestNode.dispatchEvent(new Event('click'))
if (this.triggerSVGClicks)
nearestNode.dispatchEvent(new Event('click'));
return
}
console.log("nearestNode clicked");