Issue #1814πŸ’¬ AnsweredOpened February 19, 2019by ateebahmed0 reactions

How to fire event which triggers component:selected with my component

Quick answerby artf

https://github.com/artf/grapesjs/issues/1813#issuecomment-466408328

Read full answer below ↓

Question

I want to select my component whenever it is dragged from blocks to canvas and rendered, I have tried with registering events on component:add, component:mount and calling editor.select(component), passing the component I get from callback, but it is not properly initialize or has properties missing, like its type is not what I expect for my component to be and its custom trait is not initialized when called through this way, but if I select the same component by clicking, the component I get in component:selected is what I expect and its trait is also rendered correctly. What am I doing wron...

Answers (2)

lock[bot]β€’ February 22, 2020

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.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

Premium plugins ship with support, regular updates, and production-ready features β€” save days of integration work.

Browse premium plugins β†’

Related tutorials

In-depth guides on the same topic.

All tutorials β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.