BUG: It's possible to drag and drop literally anything inside grapesjs canvas
Question
GrapesJS version
- I confirm to use the latest version of GrapesJS
What browser are you using?
Chrome
Reproducible demo link
https://grapesjs.com/demo.html
Describe the bug
How to reproduce the bug?
- Try select for example whole sidebar tools/text/everything
- Grab and drop it on canvas
What is the expected behavior? Probably copy paste just text/sanitized html or it's possible to drag and drop only elements i made to be droppable
What is the current behavior?
I can drag and drop literally anything inside canvas.
Code of Conduct
- I agree to follow this project's Code of Conduct
Answers (1)
You can take control over what is dropped inside the canvas via canvas:dragdata event
https://jsfiddle.net/artur_arseniev/87rcb24n/
Related Questions and Answers
Continue research with similar issue discussions.
Issue #5268
BUG: autoplay for youtube or vimeo doesn't work
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome v115 Reproducible demo link https:/...
Issue #4249
BUG: image src won't change in exported HTML
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? chrome 100 Reproducible demo link https://...
Issue #5729
BUG: editing/replacing the text inside of a link
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome v122 Reproducible demo link https:/...
Issue #5378
BUG: Uncaught TypeError: Cannot read properties of undefined (reading 'Canvas') while dragging a component in Layer Manager Panel
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome v116.0.5845.97 Reproducible demo li...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.