Search code examples
javascriptjquerysummernote

Summernote - Paragraph button is not showing the dropdown menu to select components


I am using Summernote rich-text editor. The "Paragraph" button does not provide the dropdown so I can not select the indent and outdent functionality.

Am I missing a cdn or is there another issue please?

My code is:

HTML:

<!-- Text Editor -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.10/summernote-bs4.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.10/summernote-bs4.js"></script>

<div class="row">
    <div class="row col-lg-12 col-md-12 col-sm-12 col-xs-12">
        <label class="control-label control-label-left col-lg-12 col-md-12 col-sm-12 col-xs-12" for="atHome">At Home:</label>
        <textarea class="summernote" id="atHome" name="atHome" rows="3"></textarea>
    </div>  
</div> <!-- Row -->

JS:

$(document).ready(function() {
    $('#atHome').summernote({
        toolbar: [
           // [groupName, [list of button]]
           ['style', ['bold', 'italic', 'underline', 'clear']],
           ['font', ['strikethrough', 'superscript', 'subscript']],
           ['fontsize', ['fontsize']],
           ['color', ['color']],
           ['para', ['ul', 'ol', 'paragraph']],
           ['height', ['height']]
        ]
    });
});

Solution

  • $(document).ready(function() {
    $('#atHome').summernote({
    
      toolbar: [
          // [groupName, [list of button]]
          ['style', ['style']],
          ['style', ['bold', 'italic', 'underline', 'clear']],
          ['font', ['strikethrough', 'superscript', 'subscript']],
          ['fontsize', ['fontsize']],
          ['color', ['color']],
          ['para', ['ul', 'ol', 'paragraph']],
          ['height', ['height']],
          ['fontname', ['fontname']],
          ['table', ['table']],
          ['insert', ['link', 'picture', 'video']],
          ['view', ['fullscreen', 'codeview', 'help']]
          ]
      });
    });
    

    Check using this one above is working for me, If your code is not working do check console for error.