question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

All buttons are triggerd when opening bootstrap 4 modal

See original GitHub issue

When using summernote withing the bootstrap4 modals. All the dropdowns are triggered and can’t be closed when opening the modal. (see screenshots)

        $('.summernote').summernote({
            lang: 'nl-NL' // default: 'en-US'
        });
       $('#myModal').modal('show');

steps to reproduce

  1. Put Textarea in modal and init
  2. Open te modal using $(‘modal’).modal(‘show’);

browser version and os version and summernote version

Chrome Summernote v0.8.9 Bootstrap 4

screenshot of issue

image

Also in the event listener there is an click event on the buttons for closing and opening the modal

image

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
juanhuertacommented, Oct 8, 2018

Ok, I think I know where is the problem in my case. The HTML admin template I’m using (https://themeforest.net/item/infinio-bootstrap-4-admin-dashboard-template/21824011) has CSS dropdown rules that always shows the dd:

.show .dropdown-menu{display:block}

This seems to be ok, but when I use summernote inside a modal the “show” class is added to the modal div when opened, and that fires the “unhide” behavior, no matter if the drop button is selected. The way I fixed is to add custom css rules to force the expected behavior for summernote dropdowns inside modals:

` div.modal div.note-btn-group.btn-group div.dropdown-menu { display: none !important; }

div.modal div.note-btn-group.btn-group.show div.dropdown-menu { display: block !important; overflow-y: scroll; max-height: 250px; left: 0; } `

1reaction
wimurkcommented, Oct 9, 2018

@juanhuerta thanks, i also use a template with a lot of styling. I first thought it was my javascript that messed it up.

I fixed the issue by using the standalone version of summernote

Read more comments on GitHub >

github_iconTop Results From Across the Web

Modal - Bootstrap
Bootstrap's modal class exposes a few events for hooking into modal functionality. All modal events are fired at the modal itself (i.e. at...
Read more >
prevent bootstrap modal from opening when a button is clicked
Bootstrap modals trigger specific events when they're popped by an element on the page, from the moment they're triggered through the moment ...
Read more >
Bootstrap Modal Plugin - W3Schools
To trigger the modal window, you need to use a button or a link. Then include the two data-* attributes: data-toggle="modal" opens the...
Read more >
Modal | Components - BootstrapVue
Modals are streamlined, but flexible dialog prompts powered by JavaScript and CSS. They support a number of use cases from user notification to...
Read more >
How to Trigger Modal for React Bootstrap | Pluralsight
When the button is clicked, the isOpen state will be set to true. Now, to display the modal, all you need to do...
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