Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Summernote dropdown doesn't work with Bootstrap navbar

I use bootstrap framework for navbar and now I wanna use summernote WYSIWYG HTML editor.

If I import bootstrap.min.js script, navbar dropdown menu works perfectly, but dropdown in summernote not (color choose etc.).

If I remove this script, summernote works, but navbar dropdown not. I also remove jquery.min.js and create own script for add class open to dropdown-toggle because with jquery.min.js summernote don't appear.

Any solution for navbar and summernote dropdown function?

like image 403
Michael Motúz Avatar asked Oct 29 '16 10:10

Michael Motúz


People also ask

Why bootstrap dropdown menu is not working?

Solution : The dropdown should be toggled via data attributes or using javascript. In the above program, we have forgotten to add a data attribute so the dropdown is not working. So add data-bs-toggle="dropdown" to toggle the dropdown.

How do I customize my Summernote toolbar?

You can customize it with popover. air option. $('#summernote'). summernote({ popover: { air: [ ['color', ['color']], ['font', ['bold', 'underline', 'clear']] ] } });

How do I create a drop down menu in bootstrap 4?

Basic Dropdown To open the dropdown menu, use a button or a link with a class of . dropdown-toggle and the data-toggle="dropdown" attribute. Add the . dropdown-menu class to a <div> element to actually build the dropdown menu.


3 Answers

Try this:

$("#yourid").summernote();
$('.dropdown-toggle').dropdown();
like image 91
aguisa Avatar answered Oct 08 '22 17:10

aguisa


Check to see that jQuery and Bootstrap are only being loaded once

like image 42
Jeffrey L. Roberts Avatar answered Oct 08 '22 17:10

Jeffrey L. Roberts


try that, i think you could be able to solve it by css

  .dropdown-menu > li > a {
           display: block;
            padding: 3px 20px;
            clear: both;
            font-weight: normal;
            line-height: 1.42857143;
            color: #333;
            white-space: nowrap;
  }
like image 23
mooga Avatar answered Oct 08 '22 16:10

mooga