How to distinguish events for custom components
Question
Hi,
I have an issue with events. I would like to distinguish events wwhen a component is loaded using 'fromElement' config from when it's loaded by dragging a block.
The problem is init or initialize are called in both case and i didn't find a property that change between both case.
Answers (2)
For the component dropped from the block manager you can use this event block:drag:stop. As arguments for the callback you get, the dropped component model (if dropped successfully) and the model of the block
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.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1875
[QUESTION] ID changes when importing html or passing html in components prop in config.
Hi, I built a component and block that I can drag and drop in the canvas. My issue is that some styles rely on the ID. I know this might no...
Issue #1481
Component.remove() gets called on drag and on trash
There is no way currently to distinguish between remove() called on component when you are dragging it. And when you pres the trash button....
Issue #362
How to create custom link components that prompts users to type link/choose link similar to Images Component Modal
Image Components have logic to call Modal and prompt user's interaction for options/configuration of image url. Would like to do similar to...
Issue #839
[QUESTION] Create custom selected component settings
There is a option in panel to change setting of component (For links, there is an option no change link - HREF - and target, for texts, id...
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.