Added flag to enable tap clicks for SVG in tested circumstances.
This commit is contained in:
Vendored
+8
-3
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user