How to identify which block is dragged into canvas ?
Question
I want to add the small if condition like: if (block1 is dragged) { //show modal }
Answers (1)
You can use the block:drag:stop event
editor.on('block:drag:stop', (component, block) => {
// ...
})
Related Questions and Answers
Continue research with similar issue discussions.
Issue #2595
[Question] Having trouble dragging external html with draggable="true"
I want to make an external html element able to be dragged into GrapesJS, like how you can drag in a block and it will add something. I hav...
Issue #1733
How to remove script tag which is added by add block manager script
Hello @artf I want to export final/production based html content excluding the script(Only which is added by block manager). Suppose i am a...
Issue #1814
[Question]: How to fire event which triggers component:selected with my component
I want to select my component whenever it is dragged from blocks to canvas and rendered, I have tried with registering events on component:...
Issue #1174
How to change the content of a dragged component?
Hi everyone, Im kinda stuck with creating a custom component. A custom block that im currently building supposed to show a modal with butto...
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.