diff --git a/src/canvas/view/CanvasView.js b/src/canvas/view/CanvasView.js index 4476757a3..9e8b73c96 100644 --- a/src/canvas/view/CanvasView.js +++ b/src/canvas/view/CanvasView.js @@ -238,6 +238,15 @@ module.exports = Backbone.View.extend({ cursor: -webkit-grabbing; } + .${ppfx}is__grabbing { + overflow-x: hidden; + } + + .${ppfx}is__grabbing, + .${ppfx}is__grabbing * { + cursor: grabbing !important; + } + ${conf.canvasCss || ''} ${conf.protectedCss || ''} `; diff --git a/src/commands/view/ComponentDrag.js b/src/commands/view/ComponentDrag.js index 73fe4f5be..96a269ac5 100644 --- a/src/commands/view/ComponentDrag.js +++ b/src/commands/view/ComponentDrag.js @@ -416,10 +416,10 @@ module.exports = { toggleDrag(enable) { const { ppfx, editor } = this; const methodCls = enable ? 'add' : 'remove'; - const canvas = this.getCanvas(); const classes = [`${ppfx}is__grabbing`]; const { Canvas } = editor; - classes.forEach(cls => canvas.classList[methodCls](cls)); + const body = Canvas.getBody(); + classes.forEach(cls => body.classList[methodCls](cls)); Canvas[enable ? 'startAutoscroll' : 'stopAutoscroll'](); } }; diff --git a/src/styles/scss/_gjs_canvas.scss b/src/styles/scss/_gjs_canvas.scss index aa0c3d8c8..0fb61635a 100644 --- a/src/styles/scss/_gjs_canvas.scss +++ b/src/styles/scss/_gjs_canvas.scss @@ -122,7 +122,7 @@ $guide_pad: 5px; &#{gjs-is(grab)}, &#{gjs-is(grabbing)} { .#{$cv-prefix}canvas__frames { - pointer-events: none; + pointer-events: none; // Need this in multi-frame mode } }