Issue #2054○ OpenOpened May 31, 2019by zhangyanwei0 reactions

Two command names (new and old) cause the command division.

待解决问题

No community answers yet. Open the original discussion on GitHub to share your solution.

Question

For some predefined commands, has a new name and old name. It tells the user to use the new one as preferred. If choosing the new command name to extend, will not works, that because of old names in the internal.

The reason is: In commands/index.js, the added or extended commands are the newly created views (extends from CommandAbstract).

Here is my code snippet, it not works if the defaultCommand option value is select-comp

const Command = editor.Commands.get('core:component-select')
editor.Commands.extend('core:component-select', {
  // Overwrite this private method to make the toolbar conditionally display.
  updateToolbar(mod) {
    ...
    Command.updateToolbar.call(this, mod)
  }
})

Answers (0)

No answers yet.

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.