最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to render CKEditor5 toolbar buttons in a new row instead of the main row? - Stack Overflow

programmeradmin3浏览0评论

I integrated CKEditor5 in my create react app from the source. Now, I want to render the overflowed buttons in a new row of the toolbar but they are displayed in a separate menu item.

How can I display buttons in a new row instead of the main row?

Here's my config:

ClassicEditor.defaultConfig = {
  toolbar: {
    items: [
      'Essentials',
      'heading',
      'Mathtype',
      'ChemType',
      '|',
      'bold',
      'italic',
      'underline',
      ....
    ]
  }
}

I integrated CKEditor5 in my create react app from the source. Now, I want to render the overflowed buttons in a new row of the toolbar but they are displayed in a separate menu item.

How can I display buttons in a new row instead of the main row?

Here's my config:

ClassicEditor.defaultConfig = {
  toolbar: {
    items: [
      'Essentials',
      'heading',
      'Mathtype',
      'ChemType',
      '|',
      'bold',
      'italic',
      'underline',
      ....
    ]
  }
}
Share Improve this question edited May 26, 2020 at 2:30 Azeem 14.8k4 gold badges34 silver badges51 bronze badges asked May 23, 2020 at 18:18 Henok TesfayeHenok Tesfaye 9,62015 gold badges51 silver badges92 bronze badges 1
  • Could you provide a list of the toolbar items that you are using? I am struggling to find a prehensive list of available toolbar items. Perhaps you could provide your entire config? Thanks! – fromage9747 Commented Oct 19, 2020 at 5:45
Add a ment  | 

2 Answers 2

Reset to default 5

Use '-' to make a line break and render items in multiple lines in toolbar

const config = {
    toolbar: {
        items: [ 'bold', 'italic', '|', 'undo', 'redo', '-', 'numberedList', 'bulletedList' ],
        viewportTopOffset: 30,
        shouldNotGroupWhenFull: true
    }
};

Use shouldNotGroupWhenFull: true property of toolbar like this:

toolbar: {
    items: [ ... ],
    shouldNotGroupWhenFull: true
}
发布评论

评论列表(0)

  1. 暂无评论