[Question]: Can't get correct component from editor.on events callback
I am using editor's events to get component after some action like component:add, block:drag:stop, but in both events I can't get my component that I dragged on canvas.
when I call component.is('my-component-type'), it gives false, I need to perform actions based on its type, which I can't when I get that from event's callback, but if I select a component and register listener on component:selected, I get the right type, how can I have this behaviour with other events?
You're doing something wrong, works as expected here https://jsfiddle.net/nfkha41p/
Next time, create a reproducible demo first, then open an issue...
Actually I can't produce it with built-in components but I'm using a custom component which extends default text component, will paste the code as I could not find which property to set to get the component type, although I had set type: 'my-type' in BlocksManager.
You're doing something wrong, works as expected here https://jsfiddle.net/nfkha41p/
Next time, create a reproducible demo first, then open an issue...
@artf Here, when I drag a first component, I get three alerts. But I need only the parent component. i.e, the first alert. Is there any solution?