How to add a custom dropdown to the quill toolbar?

See original GitHub issue

I’ve been trying to add a custom dropdown in the toolbar without any luck so far. There is a similar question here quilljs/quill#1817 but the proposed solution did not worked out for me (and it seems a bit strange). I have already customized my toolbar with some custom buttons like this:

<quill-editor #editor [formControl]="body" (onEditorCreated)="onEditorCreated($event)">
  <div quill-editor-toolbar>

    <!-- Basic buttons -->
    <span class="ql-formats">
      <button class="ql-bold" [title]="'Bold'"></button>
      <button class="ql-italic" [title]="'Italic'"></button>
      <button class="ql-underline" [title]="'Underline'"></button>
      <button class="ql-strike" [title]="'Strike'"></button>
    </span>

    <!-- Size -->
    <span class="ql-formats">
      <select class="ql-size" [title]="'Size'">
        <option value="small"></option>
        <option selected></option>
        <option value="large"></option>
        <option value="huge"></option>
      </select>
    </span>

    <!-- Custom actions -->
    <span class="ql-formats">
      <button [title]="'Signature'" (click)="onAddSignature()">
        <mat-icon fontSet="fontawesome" fontIcon="fa-pencil"></mat-icon>
      </button>
      <button [title]="'Unsubscribe'" (click)="onAddUnsubscribeLink()">
        <mat-icon fontSet="fontawesome" fontIcon="fa-optin-monster"></mat-icon>
      </button>
    </span>

  </div>
</quill-editor>

But when I try to add a custom dropdown using the markup, the dropdown is shown without any options. To provide a bit more context I am trying to achieve a line spacing solution similar to this: https://github.com/quilljs/quill/issues/197#issuecomment-306092948

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
loremapscommented, Jan 22, 2018

It appears I was missing some CSS. Please check styles.css here

I still have a few issues with the default value, but hopefully I am on the right track now.

1reaction
KillerCodeMonkeycommented, Jan 25, 2018

nice you got this one thing going for you 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to add a custom dropdown aka picker to the quill toolbar?
var myDropdown = quill.import('ui/picker'); myDropdown = [ ...
Read more >
Adding a custom drop down tool to the Quill Editor with ...
Here is a full demo adding a custom drop down tool and a custom button ... Create a Quill Editor instance with some...
Read more >
Adding a custom drop-down toolbar to react-quill
It is surprisingly unintuitive to add a custom drop-down toolbar to `quilljs`. ... 'react-quill/dist/quill.snow.css'; import ReactQuill from 'react-quill'; ...
Read more >
Toolbar Module - Quill Rich Text Editor
The Toolbar module allow users to easily format Quill's contents. ... Adding a custom handler will overwrite the default toolbar and theme behavior....
Read more >
Quill Editor with dropdown for special links - CodePen
Add Class(es) to <html> ... Adding Classes. In CodePen, whatever you write in the HTML editor is what goes within the <body> tags...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found