All buttons are triggerd when opening bootstrap 4 modal
See original GitHub issueWhen 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
- Put Textarea in modal and init
- 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
Also in the event listener there is an click event on the buttons for closing and opening the modal
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:12 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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; } `
@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