Issue #748Opened January 11, 2018by austinbiggs5 reactions

component:remove action

Question

Going through the available events, I'm curious as to why there is no "component:remove" action?

I've taken the approach of triggering the action by modifying the tlb-delete action. I would assume there's a better way, I'm just not sure what that would be quite yet.

      defaultCommands['tlb-delete'] = {
        run: function run(ed) {
          var sel = ed.getSelected();

          if (!sel || !sel.get('removable')) {
            console.warn('The element is not removable');
            return;
          }

          ed.select(null);
          sel.destroy();
          
          em && em.trigger('component:remove', null);
        }
      };

Answers (3)

artfJanuary 13, 20184 reactions

Added for the next release

ryandebaJanuary 12, 20181 reactions

I would also be interested in having a component:remove event 👍

lock[bot]September 18, 20190 reactions

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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.