From 05dfc6bb20ff75b79b5231d8547b60f615215514 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sun, 21 Apr 2019 17:03:03 +0200 Subject: [PATCH] Avoid the default link behaviour in the canvas --- src/canvas/view/CanvasView.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/canvas/view/CanvasView.js b/src/canvas/view/CanvasView.js index a7de63b18..89d8f211a 100644 --- a/src/canvas/view/CanvasView.js +++ b/src/canvas/view/CanvasView.js @@ -253,6 +253,12 @@ module.exports = Backbone.View.extend({ this.frame.el.contentWindow.onscroll = this.onFrameScroll; this.frame.udpateOffset(); + // Avoid the default link behaviour in the canvas + body.on( + 'click', + ev => ev && ev.target.tagName == 'A' && ev.preventDefault() + ); + // When the iframe is focused the event dispatcher is not the same so // I need to delegate all events to the parent document const doc = document;