简体   繁体   English

CKEditor 5工具栏固定位置

[英]CKEditor 5 toolbar fixed position

When you are adding long content in CKEditor 5 classic, on scroll the toolbar becomes fixed to the top in the browser window. 当您在CKEditor 5 classic中添加长内容时,滚动工具栏将固定在浏览器窗口的顶部。
But I have a fixed positioned white logo area with a menu bar beneath and the toolbar appears above them: 但我有一个固定的白色徽标区域,下面有一个菜单栏,工具栏显示在它们上方:

在此输入图像描述

How can I make it stay under my fixed header/navigation? 如何让它保持在我的固定标题/导航下?

I've managed to find the answer: 我找到了答案:

  1. You have to install npm install --save @ckeditor/ckeditor5-ui 你必须安装npm install --save @ckeditor/ckeditor5-ui
  2. Add to the config: viewportTopOffset : Number 添加到配置: viewportTopOffset : Number

example: 例:

ClassicEditor.defaultConfig = {
toolbar: {      
    viewportTopOffset : 50,    <-- height of fixed header
    items: [
        'heading',
        '|',
        'highlight',
        '|',
        'bold',
        'italic',
        ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM