-
Hi there, I am trying to detect when the user removes a component from the canvas by listening to the "component:remove" event. This works fine for simple components but will trigger multiple times if the removed component has child components. Is there a way to capture just a single event? (I am interested in capturing the user action of removing something, regardless of the chain on removals that this action will trigger). Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
artf
Nov 18, 2022
Replies: 1 comment 1 reply
-
Would it work for your case checking the selected component? editor.on('component:remove', (removed) => {
if (removed === editor.getSelected()) {
// ...
}
}) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
protozoo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would it work for your case checking the selected component?