Issue #2241💬 AnsweredOpened September 4, 2019by adriangroch0 reactions

Is this the expected behaviour of the RichTextEditor?

快速解答by artf

mmm wrong key in docs... it should be thanks for the report

Read full answer below ↓

Question

When the rte section of the editor config is defined, I'm assuming that the defined default actions should reflect the actions array:

const editor = grapesjs.init({
  // ...
  rte: {
    actions: ['bold']
  }
});

Meaning that this should should only render the bold action

Instead all default actions are instantiated: 'bold', 'italic', 'underline', 'strikethrough', 'link' See: https://codesandbox.io/s/pedantic-sky-qs5qj

Additionally, I've cloned the branch locally, and have replaced the actions array in src/rich_text_editor/config/config.js:

export default {
  stylePrefix: 'rte-',

  // If true, moves the toolbar below the element when the top canvas
  // edge is reached
  adjustToolbar: 1,

  // Default RTE actions
  // actions: ['bold', 'italic', 'underline', 'strikethrough', 'link']
  actions: []
};

And the same behavior is present.

Is this the expected default behavior, or am I missing something?

Answers (1)

artfSeptember 6, 2019

mmm wrong key in docs... it should be

const editor = grapesjs.init({
  // ...
  richTextEditor: {
    actions: ['bold']
  }
});

thanks for the report

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 →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.