Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quill: How to prevent toolbar from scrolling and set the height?

I am trying to follow the sample at https://quilljs.com/playground/#autogrow-height but have problems setting the height of the editor box and preventing the toolbar from scrolling off-screen.

My code is:

<div id="editorcontainer" style="height:10em; min-height:100%; overflow-y:auto;">
   <div id="editor" name="editor" style="min-height:100%; height:auto;"></div>
</div>

<script>
  var quill = new Quill("#editor",{
     modules: {
       toolbar: [ ... ]
         },
         scrollingContainer: "#editorcontainer",
         theme: "snow"
     });
</script>

The JS Filddle is available at https://jsfiddle.net/OldGeezer/xpvt214o/556844/

The output looks like this:

enter image description here

There are two problems:

  1. The tool bar is not fixed and scrolls.
  2. The vertical scrollbar has a scrollable region all the time, even when the editor is empty.

How do I solve these two problems?

like image 372
Old Geezer Avatar asked Oct 19 '25 17:10

Old Geezer


1 Answers

I had to modify two of quill's classes to get what I wanted. Like so

.ql-container.ql-snow {
    height: auto;
}
.ql-editor {
    height: 150px;
    overflow-y: scroll;
}
like image 98
Some guy Avatar answered Oct 21 '25 08:10

Some guy