GrapesJS / grapesjs

Free and Open source Web Builder Framework. Next generation tool for building templates without coding
https://grapesjs.com
BSD 3-Clause "New" or "Revised" License
22.36k stars 4.05k forks source link

[BUG]: When dragging a block over the canvas, JS in script, is appended in canvas before dropping the block. #1941

Closed simplecommerce closed 5 years ago

simplecommerce commented 5 years ago

You're submitting a BUG

Are you using the latest release (older versions are NOT supported)?

v0.14.57

Are you facing the bug with your local copy of GrapesJS or with the current demo?

Both.

Are you able to reproduce the bug from the demo?

YES

What is the expected behavior?

Based on our exchange, script should not be appended until block is dropped in canvas.

What happens instead?

When dragging the block over the canvas, the script gets appended without even releasing the block. If you keep dragging over and out, the script gets appended multiple times.

If you're able to reproduce the bug indicate all the necessary steps

  1. Go to https://grapesjs.com/demo.html.
  2. Clear the canvas or not.
  3. Inspect the canvas and open the console.
  4. Go to editor blocks, and drag TABS block over the canvas and out and back again without actually releasing the block in the canvas.
  5. Look at the console elements in the div containing gjs-js-cont class. There will be a script for every time you have dragged the same block over and out of the canvas.

Attach screenshots (using KAP/LICEcap), screencasts or live demo

https://www.useloom.com/share/2518c5b8f425423ea9beab803b980d72

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.